Sheet

Extends the Dialog component to display content that complements the main content of the screen.

Installation

ng g @spartan-ng/cli:ui sheet

Usage

import { HlmSheetImports } from '@spartan-ng/helm/sheet';
<hlm-sheet>
  <button hlmSheetTrigger hlmBtn variant="outline">Open</button>
  <hlm-sheet-content *hlmSheetPortal="let ctx">
    <hlm-sheet-header>
      <h3 hlmSheetTitle>Are you absolutely sure?</h3>
      <p hlmSheetDescription>This action cannot be undone. This will permanently delete your account and remove your data from our servers.</p>
    </hlm-sheet-header>
  </hlm-sheet-content>
</hlm-sheet>

Examples

Side

No Close

Size

You can adjust the size of the sheet by adding CSS classes to hlm-sheet-content .

Close Sheet

Open From Dropdown

Declare the hlm-sheet outside of the dropdown's ng-template and open it from a menu item with sheet.open() . Nesting the sheet inside the template destroys it when the dropdown closes, which breaks the open animation.

RTL

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

Brain API

BrnSheetClose

Selector: button[brnSheetClose]

BrnSheetContent

Selector: [brnSheetContent]

Inputs

PropTypeDefaultDescription
class string | null | undefined undefined -
context T | undefined undefined -

BrnSheetDescription

Selector: [brnSheetDescription]

BrnSheetOverlay

Selector: [brnSheetOverlay],brn-sheet-overlay

Inputs

PropTypeDefaultDescription
class string | null | undefined undefined -

BrnSheetTitle

Selector: [brnSheetTitle]

BrnSheetTrigger

Selector: button[brnSheetTrigger]

Inputs

PropTypeDefaultDescription
side 'top' | 'bottom' | 'left' | 'right' | undefined undefined Override the side from where the sheet appears for this trigger.
id string `brn-dialog-trigger-${++triggerIdSequence}` -
type 'button' | 'submit' | 'reset' 'button' -
brnDialogTriggerFor BrnDialog | undefined undefined -

BrnSheet

Selector: [brnSheet],brn-sheet

ExportAs: brnSheet

Inputs

PropTypeDefaultDescription
side 'top' | 'bottom' | 'left' | 'right' 'top' Specifies the side of the screen where the sheet will appear.
id string `brn-dialog-${++dialogIdSequence}` -
state BrnDialogState | null null -
role BrnDialogOptions['role'] this._defaultOptions.role -
hasBackdrop boolean this._defaultOptions.hasBackdrop -
positionStrategy BrnDialogOptions['positionStrategy'] this._defaultOptions.positionStrategy -
scrollStrategy BrnDialogOptions['scrollStrategy'] | 'close' | 'reposition' | null this._defaultOptions.scrollStrategy -
restoreFocus BrnDialogOptions['restoreFocus'] this._defaultOptions.restoreFocus -
closeOnOutsidePointerEvents boolean this._defaultOptions.closeOnOutsidePointerEvents -
attachTo BrnDialogOptions['attachTo'] this._defaultOptions.attachTo -
attachPositions BrnDialogOptions['attachPositions'] this._defaultOptions.attachPositions -
autoFocus BrnDialogOptions['autoFocus'] this._defaultOptions.autoFocus -
disableClose boolean this._defaultOptions.disableClose -
aria-describedby BrnDialogOptions['ariaDescribedBy'] this._defaultOptions.ariaDescribedBy -
aria-labelledby BrnDialogOptions['ariaLabelledBy'] this._defaultOptions.ariaLabelledBy -
aria-label BrnDialogOptions['ariaLabel'] this._defaultOptions.ariaLabel -
aria-modal boolean this._defaultOptions.ariaModal -

Outputs

PropTypeDefaultDescription
closed TResult --
stateChanged BrnDialogState --

Helm API

HlmSheetClose

Selector: button[hlmSheetClose]

HlmSheetContent

Selector: hlm-sheet-content

Inputs

PropTypeDefaultDescription
showCloseButton boolean true -

HlmSheetDescription

Selector: [hlmSheetDescription]

HlmSheetFooter

Selector: [hlmSheetFooter],hlm-sheet-footer

HlmSheetHeader

Selector: [hlmSheetHeader],hlm-sheet-header

HlmSheetOverlay

Selector: [hlmSheetOverlay],hlm-sheet-overlay

Inputs

PropTypeDefaultDescription
class ClassValue '' -

HlmSheetPortal

Selector: [hlmSheetPortal]

Inputs

PropTypeDefaultDescription
context T | undefined undefined -
class string | null | undefined undefined -

HlmSheetTitle

Selector: [hlmSheetTitle]

HlmSheetTrigger

Selector: button[hlmSheetTrigger]

Inputs

PropTypeDefaultDescription
id string `brn-dialog-trigger-${++triggerIdSequence}` -
side 'top' | 'bottom' | 'left' | 'right' | undefined undefined Override the side from where the sheet appears for this trigger.
type 'button' | 'submit' | 'reset' 'button' -

HlmSheet

Selector: hlm-sheet

ExportAs: hlmSheet

Inputs

PropTypeDefaultDescription
side 'top' | 'bottom' | 'left' | 'right' 'top' Specifies the side of the screen where the sheet will appear.
id string `brn-dialog-${++dialogIdSequence}` -
state BrnDialogState | null null -
role BrnDialogOptions['role'] this._defaultOptions.role -
hasBackdrop boolean this._defaultOptions.hasBackdrop -
positionStrategy BrnDialogOptions['positionStrategy'] this._defaultOptions.positionStrategy -
scrollStrategy BrnDialogOptions['scrollStrategy'] | 'close' | 'reposition' | null this._defaultOptions.scrollStrategy -
restoreFocus BrnDialogOptions['restoreFocus'] this._defaultOptions.restoreFocus -
closeOnOutsidePointerEvents boolean this._defaultOptions.closeOnOutsidePointerEvents -
attachTo BrnDialogOptions['attachTo'] this._defaultOptions.attachTo -
attachPositions BrnDialogOptions['attachPositions'] this._defaultOptions.attachPositions -
autoFocus BrnDialogOptions['autoFocus'] this._defaultOptions.autoFocus -
disableClose boolean this._defaultOptions.disableClose -
aria-describedby BrnDialogOptions['ariaDescribedBy'] this._defaultOptions.ariaDescribedBy -
aria-labelledby BrnDialogOptions['ariaLabelledBy'] this._defaultOptions.ariaLabelledBy -
aria-label BrnDialogOptions['ariaLabel'] this._defaultOptions.ariaLabel -
aria-modal boolean this._defaultOptions.ariaModal -

Outputs

PropTypeDefaultDescription
closed TResult --
stateChanged BrnDialogState --
Sidebar Separator