Search code examples
angularangular-material2sticky

Create sticky button element with Angular material2


Url project: https://stackblitz.com/edit/angular-kcjutu?file=app/bottom-sheet-overview-example.html

enter image description here enter image description here

I want to have a button that opens a bottom-shet, positioned on top of it, how could I do it?


Solution

  • What I would do is to make fixed position for the sticky element. Then use angular to control the display style:

    [style.display]="divOpenStatus ? 'block' : 'none'"
    

    I quickly made a demo at https://stackblitz.com/edit/demo-fixed-bottom-div