Angular Action Sheet | ng-hub-ui-action-sheet

Angular action sheet opened from a service: actions with roles, grouped or flat, handlers that can refuse to close, and dismissal by backdrop, keyboard or a drag of the sheet.

API reference

Here's the full contract for action-sheet: everything you can bind, listen to, project and theme, gathered in one place. Wire up what you need and style what you want — it's standalone and signal-friendly.

Inputs

Dial action-sheet in with 10 inputs. Bind them like any Angular @Input.

NameTypeDefaultDescription
buttonsRequired(HubActionSheetButton | HubActionSheetGroup)[]The actions, flat or in titled groups.
headerstringTitle of the sheet, and its accessible name.
subHeaderstringSecondary line under the header.
variantstringSemantic accent, read as --hub-sys-color-<variant>.
backdropDismissbooleantrueClicking the backdrop dismisses the sheet.
keyboardbooleantrueEscape dismisses the sheet.
swipeToClosebooleantrueDragging the sheet down past its threshold dismisses it.
animationbooleantrueAnimate entry and exit. Ignored under prefers-reduced-motion.
panelClassstring | string[]Extra classes on the sheet element, for theming one sheet.
ariaLabelstringAccessible name when there is no header to give one.

Outputs

No outputs documented yet.

Methods

Drive action-sheet from code — 8 methods on its programmatic surface.

NameSignatureReturnsDescription
HubActionSheet.openopen<D>(options: HubActionSheetOptions<D>): HubActionSheetRef<D>Mounts a sheet on the document and returns the handle to its outcome.
HubActionSheetRef.resultresult: Promise<HubActionSheetResult<D>>Resolves once: with the role and data of the chosen action, or with how the sheet was dismissed.
HubActionSheetRef.closed$closed$: Observable<HubActionSheetResult<D>>The same value as result, for callers living in streams.
HubActionSheetRef.dismissdismiss(role?: 'backdrop' | 'escape' | 'swipe' | string): voidCloses the sheet from the outside, reporting the given role.
HubActionSheetRef.settledsettled: booleanWhether the sheet has already produced its result, so a caller can tell an open sheet from a closed one.
provideHubActionSheetprovideHubActionSheet(config: Partial<HubActionSheetConfig>): EnvironmentProvidersSets the application-wide defaults every sheet starts from: the four behaviour flags plus variant and panelClass.
HUB_ACTION_SHEET_CONFIGInjectionToken<HubActionSheetConfig>The token the service reads. Provide it directly to replace the whole configuration instead of merging into it.
HUB_ACTION_SHEET_DEFAULTSHubActionSheetConfigWhat a sheet does when nobody says otherwise: backdropDismiss, keyboard, swipeToClose and animation, all true.

Templates

No templates documented yet.