Extends the Dialog component to display content that complements the main content of the screen.
Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-sheet> ├── [appSheetTrigger] └── <app-sheet-content> ├── generated portal, overlay, and positioner ├── [appSheetHeader] │ ├── [appSheetTitle] │ └── [appSheetDescription] ├── content ├── [appSheetFooter] (optional) ├── [appSheetClose] (optional) └── generated close button (optional)
Examples
Bottom
Loading...
Comments
Loading...
Default
Loading...
Event
Loading...
Order
Loading...
Payment
Loading...
Shortcuts
Loading...
API Reference
<app-sheet>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the sheet part IDs. |
ids | Partial<DialogElementIds> | undefined | — | Overrides the generated IDs for individual dialog parts. |
aria-label | string | undefined | — | Accessible name used when no visible title is rendered. |
open | boolean | undefined | — | Open state when controlled. Supports Angular two-way binding. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
modal | boolean | true | Makes content outside the sheet inert while it is open. |
closeOnInteractOutside | boolean | true | Closes the sheet after an interaction outside its content. |
closeOnEscape | boolean | true | Closes the sheet when Escape is pressed. |
preventScroll | boolean | modal | Prevents document scrolling while the sheet is open. |
trapFocus | boolean | modal | Keeps keyboard focus inside the sheet while it is open. |
restoreFocus | boolean | true | Restores focus when the sheet closes. |
initialFocusEl | (() => HTMLElement | null | false) | undefined | — | Returns the element to focus when the sheet opens. |
finalFocusEl | (() => HTMLElement | null) | undefined | — | Returns the element to focus when the sheet closes. |
persistentElements | Array<() => Element | null> | undefined | — | Elements that remain interactive outside a modal sheet. |
triggerValue | string | null | undefined | — | Active trigger value when controlled. Supports two-way binding. |
defaultTriggerValue | string | null | undefined | — | Initial active trigger value when uncontrolled. |
Use [(open)]="open" or [(triggerValue)]="triggerValue" for two-way binding. The sheet uses the
Angular dialog primitive internally, so its state and event detail types use the Dialog prefix.
Outputs
| Output | Type | Description |
|---|---|---|
openChange | boolean | undefined | Emits the current open state. |
triggerValueChange | string | null | undefined | Emits the current active trigger value. |
escapeKeyDown | KeyboardEvent | Emits when Escape is pressed while the sheet is open. |
focusOutside | DialogFocusOutsideEvent | Emits when focus moves outside the sheet content. |
interactOutside | DialogInteractOutsideEvent | Emits when an interaction occurs outside the content. |
pointerDownOutside | DialogPointerDownOutsideEvent | Emits when a pointer is pressed outside the content. |
requestDismiss | CustomEvent | Emits when a layered interaction requests dismissal. |
openChangeDetails | DialogOpenChangeDetails | Emits details whenever the open state changes. |
triggerValueChangeDetails | DialogTriggerValueChangeDetails | Emits details whenever the active trigger changes. |
[appSheetTrigger]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
value | string | undefined | — | Identifies this trigger when multiple triggers exist. |
<app-sheet-content>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
side | "top" | "right" | "bottom" | "left" | "right" | Edge from which the sheet enters. |
showCloseButton | boolean | true | Renders the generated close button. |
class | string | "" | Additional classes applied to the content panel. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
DialogContext | Structural directive [dialog-context] included by SheetImports. |
DialogRootProvider | Directive for providing an externally created dialog API, included by imports. |
SheetImports | Readonly collection containing all sheet UI directives and context helpers. |
Angular
React
Solid
Svelte
Vue