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
buttons (open options)Required(HubActionSheetButton | HubActionSheetGroup)[]—The actions, flat or in titled groups.
header (open options)string—Title of the sheet, and its accessible name.
subHeader (open options)string—Secondary line under the header.
variant (open options)string—Semantic accent, read as --hub-sys-color-<variant>.
backdropDismiss (open options)booleantrueClicking the backdrop dismisses the sheet.
keyboard (open options)booleantrueEscape dismisses the sheet.
swipeToClose (open options)booleantrueDragging the sheet down past its threshold dismisses it.
animation (open options)booleantrueAnimate entry and exit. Ignored under prefers-reduced-motion.
panelClass (open options)string | string[]—Extra classes on the sheet element, for theming one sheet.
ariaLabel (open options)string—Accessible 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): void—Closes the sheet from the outside, reporting the given role.
HubActionSheetRef.settledsettled: boolean—Whether the sheet has already produced its result, so a caller can tell an open sheet from a closed one.
provideHubActionSheetprovideHubActionSheet(config: Partial<HubActionSheetConfig>): EnvironmentProviders—Sets 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_DEFAULTSHubActionSheetConfig—What a sheet does when nobody says otherwise: backdropDismiss, keyboard, swipeToClose and animation, all true.

Templates

No templates documented yet.