RadSideDrawer: Transitions

This article explains how to set the transition type of the RadSideDrawer with Angular 2.0.

Set transition with Angular 2.0

RadSideDrawer offers the following transition options:

  • FadeTransition - provides a fading animation for the displayed drawer content.
  • PushTransition - provides an animation showing the main content being pushed out by the side content.
  • RevealTransition - provides an animation showing the main content uncovering the side content.
  • ReverseSlideOutTransition - provides an animation showing the drawer content reverse sliding out of the main content.
  • ScaleDownPusherTransition - provides a scale down animation of the drawer content.
  • ScaleUpTransition - provides a scale up animation of the drawer content from beneath the main content.
  • SlideAlongTransition - provides an animation of the side content sliding along the main content.
  • SlideInOnTopTransition - provides an animation of the side content sliding in on top of the main content.

The trasition style of the RadSideDrawer can be manipulated through the transition property of the RadSideDrawerComponent.

<RadSideDrawer [transition]="sideDrawerTransition" tkExampleTitle tkToggleNavButton>

In the snippet above we have binded the transition property to the sideDrawerTransition variable. Now we should create the sideDrawerTransition variable and give it a value.

export class SideDrawerTransitionsComponent implements OnInit {
    constructor(private _page: Page, private _changeDetectionRef: ChangeDetectorRef) {
        this._page.on("loaded", this.onLoaded, this);
    }

    @ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;

    private drawer: SideDrawerType;

    public sideDrawerTransition: DrawerTransitionBase;