Drawer

A dialog that slides in from the bottom of the screen. Designed after the macOS/iOS bottom sheet pattern.

Installation

ng g @spartan-ng/cli:ui drawer

Usage

import { HlmDrawerImports } from '@spartan-ng/helm/drawer';
<hlm-drawer>
  <button hlmDrawerTrigger hlmBtn variant="outline">Open</button>
  <hlm-drawer-content *hlmDrawerPortal="let ctx">
    <hlm-drawer-header>
      <h3 hlmDrawerTitle>Are you absolutely sure?</h3>
      <p hlmDrawerDescription>This action cannot be undone.</p>
    </hlm-drawer-header>
  </hlm-drawer-content>
</hlm-drawer>

Examples

Direction

You can change the direction the drawer slides in from using the direction input on the trigger.

Nested

Drawers can be nested within each other to create multi-step or drill-down experiences. Use a nested hlm-drawer inside the content of another drawer.

RTL

To enable RTL support in spartan-ng, see the RTL configuration guide.

Brain API

BrnDrawerClose

Selector: button[brnDrawerClose]

BrnDrawerContent

Selector: [brnDrawerContent]

BrnDrawerDescription

Selector: [brnDrawerDescription]

BrnDrawerHandle

Selector: [brnDrawerHandle]

Inputs

PropTypeDefaultDescription
closeThreshold number DEFAULT_CLOSE_THRESHOLD -

BrnDrawerOverlay

Selector: [brnDrawerOverlay],brn-drawer-overlay

BrnDrawerTitle

Selector: [brnDrawerTitle]

BrnDrawerTrigger

Selector: button[brnDrawerTrigger]

Inputs

PropTypeDefaultDescription
direction 'bottom' | 'top' | 'left' | 'right' | undefined undefined -

BrnDrawer

Selector: [brnDrawer],brn-drawer

ExportAs: brnDrawer

Inputs

PropTypeDefaultDescription
direction 'bottom' | 'top' | 'left' | 'right' bottom -

Helm API

HlmDrawerClose

Selector: button[hlmDrawerClose]

HlmDrawerContent

Selector: hlm-drawer-content

HlmDrawerDescription

Selector: [hlmDrawerDescription]

HlmDrawerFooter

Selector: [hlmDrawerFooter],hlm-drawer-footer

HlmDrawerHeader

Selector: [hlmDrawerHeader],hlm-drawer-header

HlmDrawerOverlay

Selector: [hlmDrawerOverlay],hlm-drawer-overlay

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmDrawerPortal

Selector: [hlmDrawerPortal]

HlmDrawerTitle

Selector: [hlmDrawerTitle]

HlmDrawerTrigger

Selector: button[hlmDrawerTrigger]

HlmDrawer

Selector: hlm-drawer

ExportAs: hlmDrawer

Dropdown Menu Dialog