@christophhu/ngx-drawer
v20.3.1
Published
Library for Angular to create drawers/sidebars with overlay.
Downloads
13
Maintainers
Readme
Ngx-drawer
Demo
Description
This repository contains an Angular 20 demo that showcases the ngx-drawer library. ngx-drawer provides a flexible side drawer for Angular apps, supporting left/right positions and over/side modes. It’s easy to customize—sizes, colors, and behavior—to match your application’s design.
Frameworks and Languages
Installation
To run this project, you need to have Node.js installed on your machine. Clone the repository and run the following commands:
npm install @christophhu/ngx-drawerUsage
Import the DrawerComponent in the app.ts.
import { DrawerComponent } from '@christophhu/ngx-drawer';
@NgModule({
imports: [
DrawerComponent,
...
]
...
})<ngx-drawer [mode]="'side'" [opened]="true" [position]="'left'" [name]="'settingsDrawer'" #settingsDrawer></ngx-drawer>ngx-drawer
position: relative
display: flex
flex-direction: column
flex: none
z-index: 110
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .35)
&.drawer-animations-enabled
transition-duration: 300ms
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1)
transition-property: visibility, margin-left, margin-right, transform, width, max-width, min-width
.drawer-content
transition-duration: 300ms
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1)
transition-property: width, max-width, min-width
&.drawer-mode-over
position: absolute
top: 0
bottom: 0
&.drawer-fixed
position: fixed
&.drawer-position-left
&.drawer-mode-side
margin-left: -#{$drawer-width}rem
&.drawer-opened
margin-left: 0
&.drawer-mode-over
left: 0
transform: translate3d(-100%, 0, 0)
&.drawer-opened
transform: translate3d(0, 0, 0)
.drawer-content
left: 0
&.drawer-position-right
&.drawer-mode-side
margin-right: -#{$drawer-width}rem
&.drawer-opened
margin-right: 0
&.drawer-mode-over
right: 0
transform: translate3d(100%, 0, 0)
&.drawer-opened
transform: translate3d(0, 0, 0)
.drawer-content
right: 0
.drawer-content
position: absolute
display: flex
flex: 1 1 auto
top: 0
bottom: 0
width: 100%
height: 100%
overflow: hidden
.drawer-overlay
position: absolute
top: 0
bottom: 0
left: 0
right: 0
z-index: 100
opacity: 1
background-color: rgba(0, 0, 0, 0.6)
&.drawer-overlay-fixed
position: fixed
&.drawer-overlay-transparent
background-color: transparentThe content of the drawer can be customized.
License
This project is licensed under the MIT License.
The MIT License (MIT) Copyright © 2025
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
