Animating nebular sidebar component
Asked Answered
A

1

5

I am using nebular sidebar component, what i'm trying to do is animating the opening and the closing of the sidebar. I checked the sidebar API but i didn't find anything that can do that ? I tried to apply css transition on the class but it didn't work, so how can i approach this ?

<nb-layout>

  <nb-layout-header subheader>
    <app-navbar style="width: 100%"></app-navbar>
  </nb-layout-header>

  <nb-sidebar [state]="'compacted'">
    <app-sidenav-menu></app-sidenav-menu>
  </nb-sidebar>

  <nb-layout-column>
    <router-outlet></router-outlet>
  </nb-layout-column>
</nb-layout>
Archives answered 7/11, 2018 at 14:48 Comment(1)
Hey, Ali Badr, please check answer from Nikita as correct.Bunnybunow
E
11

As I see it, the Nebular sidebar contains container inside:

<nb-sidebar>
  <div.main-container>
  ...
  </div>
</nb-sidebar>

And if you add transitions for both, sidebar and div.main-container it should provide the desired behavior.

nb-sidebar,
nb-sidebar > div.main-container {
  transition: width 1s;
}
Entertaining answered 8/11, 2018 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.