Component

Action Sheet

An iOS-style bottom sheet of choices — a data-driven preset over the drawer, with destructive and cancel roles.

Installation

import { WrActionSheet } from 'ngwr/action-sheet';

@Component({ imports: [WrActionSheet] })
export class MyComponent {}

Basic

Pass actions; picking one emits action and closes the sheet. role: 'destructive' paints the row red, role: 'cancel' drops it to a separate group at the bottom. Dismissing via the backdrop, Escape, or a swipe-down closes without emitting.

<wr-btn (click)="open.set(true)">Open action sheet</wr-btn>

<wr-action-sheet [(open)]="open" title="Photo" [actions]="actions" (action)="onPick($event)" />
protected readonly open = signal(false);

protected readonly actions: WrActionSheetAction[] = [
  { label: 'Take Photo', value: 'camera' },
  { label: 'Choose from Library', value: 'library' },
  { label: 'Delete', role: 'destructive', value: 'delete' },
  { label: 'Cancel', role: 'cancel' },
];

onPick(action: WrActionSheetAction): void {
  // action.value === 'camera' | 'library' | 'delete' | 'cancel'
}
Open action sheet

API

NameDescriptionTypeDefault
openWhether the sheet is open (two-way).booleanfalse
actionsThe rows to offer.readonly WrActionSheetAction[][]
titleBold heading above the rows.string''
messageMuted sub-heading under the title.string''
titleFallbackName announced for the dialog when there is no visible title. Falls back to actionSheet.label.string | nullnull
(action)Fires with the chosen row (never on a dismiss).WrActionSheetAction
WrActionSheetActionA single row.interface
labelRow label.string
valuePayload echoed back in action.unknown
iconOptional leading wr-icon name.string
role'destructive' paints danger; 'cancel' drops to a bottom group.'default' | 'destructive' | 'cancel''default'
disabledDisable the row.booleanfalse