Skip to content
OGE logoOGE

Buttons API

Complete API reference for @oge-ui/buttons — every input, output, imperative method and supporting type, compiled from the source TSDoc. Cancelable and gesture behavior is documented on the demo pages.

Properties Methods Events Types

OgeButton

oge-button

Properties 31

Appearance

Name Type DefaultDescription
textstring''Label text; alternative (or addition) to projecting content.
hintstring | undefined—Tooltip — rendered as the native title attribute.
stylingModeOgeButtonStylingMode | undefined—Fill style; falls back to the enclosing group, then contained.
severityOgeButtonSeverity | undefined—Semantic color; falls back to the enclosing group, then normal.
sizeOgeButtonSize | undefined—Size preset; falls back to the enclosing group, then md.
colorstring | undefined—Custom main color (any CSS color) — overrides the severity palette; the soft tint is derived via color-mix.
iconPositionOgeButtonIconPosition'before'Where [ogeButtonIcon] content renders relative to the label.
badgestring | number | boolean | undefined—String/number renders a pill (numbers cap at 99+ and join the accessible name); true renders a plain dot.

Behavior

Name Type DefaultDescription
disabledbooleanfalseDisables the button.
loadingmodel<boolean>falseBusy state — two-way; managed automatically while action is pending.
action(() => unknown) | undefined—Async click handler: sets loading while pending, single-flight; sync returns emit actionDone immediately.
clickGuardboolean | OgeClickGuardOptionsfalseRate-limits the clicked output; true throttles with config.clickGuardMs.
holdToConfirmboolean | OgeHoldToConfirmOptionsfalseFires clicked only after an uninterrupted press; wins over autoRepeat. true uses config.holdToConfirmMs.
autoRepeatboolean | OgeAutoRepeatOptionsfalseRepeats clicked while held; ignored when holdToConfirm is set.
useSubmitBehaviorbooleanfalseRenders type="submit" so the button submits the enclosing form.
buttonType'button' | 'submit' | 'reset''button'Native button type; useSubmitBehavior is sugar for submit.
valuestring | undefined—Selection key inside an <oge-button-group>; unused standalone.
togglebooleanfalseMakes the button a toggle button: each accepted click flips selected and the native button renders aria-pressed. Ignored inside a single/multiple <oge-button-group>, which owns the selection.
pressedboolean | undefinedundefinedHost-controlled pressed state: renders aria-pressed and the pressed look, and a click never flips it (unlike toggle) — update it from your own state.
shapeOgeButtonShape'default''default' (the theme radius) or 'pill' (fully rounded ends; circular when icon-only).
fluidbooleanfalseStretches the button to the full width of its container.
loadingTextstringundefinedLabel shown (and announced) while loading — Saving… instead of Save.
iconClassstringundefinedClass(es) for a leading icon rendered as an empty <i> — the hook for an icon font the app already ships; no projected [ogeButtonIcon] needed.
selectedmodel<boolean>falsePressed state of a toggle button — two-way ([(selected)]). Unused without toggle and inside a selection group.
tabIndexnumber0Tab order of the native button.
accessKeystring | undefined—Native accesskey of the inner button.
messagesPartial<OgeButtonsMessages> | undefined—Per-instance overrides of user-facing strings.

Accessibility

Name Type DefaultDescription
ariaLabelstring | undefined—Accessible name of the native button — required for icon-only buttons.
ariaHasPopupstring | undefined—aria-haspopup of the native button — for popup triggers.
ariaExpandedboolean | undefined—aria-expanded; undefined omits the attribute.
ariaControlsstring | undefined—aria-controls — id of the controlled popup.

Methods 2

Name Type Description
focus(): voidvoidMoves keyboard focus to the inner native button (preventScroll: true).
isDisabledSignal<boolean>Read-only computed: disabled, busy, or inside a disabled group.

Events 6

Name Type Description
clickedOgeButtonClickEventFires after the gesture/guard pipeline accepts a click. Bind this instead of native (click), which bypasses every guard.
actionDoneOgeButtonActionDoneEventThe action callback settled successfully.
actionFailedOgeButtonActionFailedEventThe action callback threw or rejected.
loadingChangebooleanImplicit output of the loading model.
selectedChangedOgeButtonSelectedChangedEventA click flipped a toggle button’s selected state — fires after the model updates and before clicked.
selectedChangebooleanImplicit output of the selected model.

Types 13

Name Type Description
OgeButtonSelectedChangedEvent{ selected: boolean; previousValue: boolean; event: MouseEvent | KeyboardEvent }Payload of selectedChanged: the new and the previous pressed state, and the click (or Space/Enter of a gesture) that did it.
OgeButtonStylingMode'contained' | 'outlined' | 'text' | 'link'Fill style.
OgeButtonShape'default' | 'pill'Corner shape of a button.
OgeButtonSeverity'normal' | 'accent' | 'success' | 'warning' | 'danger'Semantic color mapped to the severity tokens.
OgeButtonSize'xs' | 'sm' | 'md' | 'lg'Height/padding preset.
OgeButtonIconPosition'before' | 'after'Icon slot placement.
OgeButtonClickEvent{ event: MouseEvent | KeyboardEvent }KeyboardEvent when produced by Space/Enter during hold/repeat.
OgeButtonActionDoneEvent{ result: unknown }Resolved value (or sync return) of action.
OgeButtonActionFailedEvent{ error: unknown }Rejection reason or thrown error of action.
OgeClickGuardOptions{ mode: 'debounce' | 'throttle'; ms?: number }ms defaults to config.clickGuardMs; true shorthand ≡ throttle.
OgeHoldToConfirmOptions{ ms?: number }Hold duration; defaults to config.holdToConfirmMs.
OgeAutoRepeatOptions{ delayMs?: number; intervalMs?: number }Defaults from config.autoRepeatDelayMs / autoRepeatIntervalMs.
OgeButtonIcondirective — [ogeButtonIcon]Marks projected content as the icon slot; placement follows iconPosition.

OgeButtonGroup

oge-button-group

Properties 8

Name Type DefaultDescription
itemsreadonly OgeButtonGroupItem[] | undefined—Data-driven items rendered after projected <oge-button> children.
selectionModeOgeButtonGroupSelectionMode'none'Selection behavior; also drives the ARIA role (toolbar / radiogroup / group).
selectedKeysmodel<readonly string[]>[]Selected values — two-way; single keeps at most one entry.
stylingModeOgeButtonStylingMode'contained'Cascaded to children without their own.
severityOgeButtonSeverity'normal'Cascaded to children without their own.
sizeOgeButtonSize'md'Cascaded to children without their own.
disabledbooleanfalseDisables every button in the group.
ariaLabelstring | undefined—Accessible name of the toolbar/radiogroup/group element.

Methods 2

Name Type Description
focus(): voidvoidMoves keyboard focus to the roving-tabindex target button.
isSelected(value: string | undefined): booleanbooleanWhether the given button value is currently selected (reactive).

Events 3

Name Type Description
itemClickOgeButtonGroupItemClickEventEvery accepted child click, before any selection change.
selectionChangedOgeButtonGroupSelectionChangedEventselectedKeys changed through user interaction.
selectedKeysChangereadonly string[]Implicit output of the selectedKeys model.

Types 4

Name Type Description
OgeButtonGroupSelectionMode'none' | 'single' | 'multiple'Selection behavior of the group.
OgeButtonGroupItem{ value: string; text?; hint?; disabled?; severity?; badge? }Data-driven item; icons require declarative children.
OgeButtonGroupItemClickEvent{ value: string | undefined; event: MouseEvent | KeyboardEvent; item?: OgeButtonGroupItem; index: number }index is DOM-order; -1 when unresolvable.
OgeButtonGroupSelectionChangedEvent{ selectedKeys: readonly string[]; addedKeys: readonly string[]; removedKeys: readonly string[] }Full state plus diffs.

OgeDropDownButton

oge-drop-down-button

Properties 23

Trigger button

Name Type DefaultDescription
textstring''Label of the (main) trigger button.
hintstring | undefined—Tooltip of the trigger.
disabledbooleanfalseDisables the whole control.
stylingModeOgeButtonStylingMode | undefined—Same fallback chain as OgeButton.
severityOgeButtonSeverity | undefined—Same fallback chain as OgeButton.
sizeOgeButtonSize | undefined—Same fallback chain as OgeButton.
colorstring | undefined—Custom main color — overrides the severity palette.
iconPositionOgeButtonIconPosition'before'Icon slot placement on the trigger.
badgestring | number | boolean | undefined—Badge on the trigger, as on OgeButton.
splitButtonbooleanfalsetrue renders a separate chevron toggle next to an action main button.
action(() => unknown) | undefined—Async click handler of the split main button (single-flight, drives loading).
clickGuardboolean | OgeClickGuardOptionsfalseClick guard of the split main button.
loadingmodel<boolean>falseBusy state of the (main) button — two-way.
messagesPartial<OgeButtonsMessages> | undefined—Per-instance overrides of user-facing strings (status rows, toggle label).

Drop-down panel

Name Type DefaultDescription
itemsreadonly OgeMenuItem[] | OgeDropDownItemsFn | undefined—Menu items — an array, or a function invoked lazily on first open (result cached until the function reference changes).
openedmodel<boolean>falsePanel visibility — two-way.
dropdownPlacementOgePopupPlacement'bottom-start'Preferred panel placement (flips/clamps automatically).
dropdownWidthnumber | 'anchor' | undefined—Fixed pixels or 'anchor' to match the button width.
dropdownClassOgeClassValue | undefined—Extra classes on the drop-down panel (a design system’s own menu class).
dropdownAttributesOgeHtmlAttributes | undefined—Extra attributes on the drop-down panel (data-testid…). Filtered by ogeSafeAttributes: event handlers, srcdoc, style, class, script URLs and the panel’s own id are dropped.
adaptiveMode / adaptiveBreakpoint'auto' | 'none' / numberconfig: 'none' / 600'auto' opens the menu as a modal bottom sheet (title from text / hint, close button, 44px rows, focus trap, Escape / backdrop / swipe dismiss) on viewports narrower than adaptiveBreakpoint px; 'none' keeps the anchored menu. App-wide defaults come from provideOgeButtonsConfig().
rememberLastActionbooleanfalseSplit mode: the last clicked item becomes the main button's label + action.
itemTemplateTemplateRef<OgeMenuItemTemplateContext> | undefined—Custom rendering for menu items — see OgeMenuList.

Methods 5

Name Type Description
open(): voidvoidOpens the panel programmatically.
close(): voidvoidCloses the panel programmatically.
toggle(): voidvoidToggles opened.
focus(): voidvoidFocuses the trigger (split mode: the chevron toggle).
panelOgeAnchoredPanelThe anchored-panel model — public so templates/tests can read panelId.

Events 7

Name Type Description
itemClickOgeDropDownButtonItemClickEventMenu item activated; the panel closes afterwards.
selectionChangedOgeDropDownSelectionChangedEventrememberLastAction mode: the remembered item changed.
clickedOgeButtonClickEventSplit mode only: the main action button was clicked. In non-split mode the trigger only toggles the panel.
actionDoneOgeButtonActionDoneEventThe split-button action settled successfully.
actionFailedOgeButtonActionFailedEventThe split-button action threw or rejected.
openedChangebooleanImplicit output of the opened model — fires on both open and close.
loadingChangebooleanImplicit output of the loading model.

Types 4

Name Type Description
OgeDropDownItemsFn() => readonly OgeMenuItem[] | Promise<readonly OgeMenuItem[]>Lazy items factory — invoked on first open.
OgeDropDownButtonItemClickEvent{ item: OgeMenuItem; index: number; checked?: boolean; event: MouseEvent | KeyboardEvent }Index within the resolved items list (separators included); checked is the next state of a checkbox/radio row (OgeMenuItem.type), undefined for plain rows.
OgeDropDownSelectionChangedEvent{ item: OgeMenuItem; previousItem: OgeMenuItem | null }Remembered-item change in rememberLastAction mode.
OgeDropDownContentdirective — [ogeDropDownContent]Replaces the item menu with arbitrary panel content; context { $implicit: () => void } closes the panel and restores focus.

OgeFab

oge-fab

Properties 9

Name Type DefaultDescription
labelstring''Accessible name of the icon-only FAB (aria-label) — and its visible text when extended. Always set it.
iconstring | undefined—SVG path data (d, 24×24 viewBox, stroked) of the icon. Project your own aria-hidden icon instead for an icon font or component.
extendedbooleanfalseShows the label as text beside the icon in a pill (Material's extended FAB); the label is then the button's content, not an aria-label.
position'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end''bottom-end'Corner or edge the FAB is pinned to; start/end are logical and mirror in RTL. Falls back to the config.
positionMode'fixed' | 'absolute' | 'static''fixed'fixed pins to the viewport with max(offset, env(safe-area-inset-*)) on the touched edges, absolute pins to the nearest positioned ancestor, static leaves it in the flow. Fixed and absolute layers sit on --oge-z-fab (below windows, popups and modals).
size'xs' | 'sm' | 'md' | 'lg''md'FAB diameter 40 / 56 / 72 px (speed-dial actions 32 / 40 / 48 px).
severity'normal' | 'accent' | 'success' | 'warning' | 'danger''accent'Fill colour — the button severity vocabulary; normal is the page surface with a hairline.
offsetstring | undefined'16px'Gap to the pinned edges (any CSS length), written to the --oge-fab-offset knob; the safe-area inset stays its floor.
disabledbooleanfalseDisables the FAB.

Methods 1

Name Type Description
focus(): voidvoidMoves focus to the button.

Events 1

Name Type Description
clickedOgeFabClickEventThe FAB was pressed (not emitted while disabled).

Types 2

Name Type Description
OgeFabClickEvent{ event: Event }Payload of clicked.
OgeFabPosition / OgeFabPositionMode / OgeFabSize / OgeFabSeveritystring unionsThe vocabularies above, single-sourced in @oge-ui/behavior.

OgeSpeedDial

oge-speed-dial

Properties 13

Name Type DefaultDescription
itemsreadonly OgeSpeedDialItem[][]The actions, nearest the FAB first — each a role="menuitem" named by its label.
labelstring | undefined—Accessible name of the FAB and the menu; falls back to messages.speedDial (Actions).
iconstring | undefined—SVG path data of the FAB glyph; default a plus that turns 45° into an ✕ while open.
direction'up' | 'down' | 'start' | 'end' | undefined—Unfold direction; default away from the pinned edge — up from a bottom FAB, down from a top one (ogeSpeedDialDirection). The arrow keys follow it.
openMode'click' | 'hover''click'hover also opens the dial while a mouse hovers it (never on touch); hover never moves focus.
labelMode'hover' | 'always' | 'none''hover'Action labels: beside the hovered / keyboard-focused action (always on hover: none screens), beside every action while open, or visually hidden — the label stays the accessible name in every mode.
openedbooleanfalseWhether the actions are shown — a two-way model() ([(opened)]). The closed menu is not rendered.
position'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end''bottom-end'Corner or edge the FAB is pinned to; start/end are logical and mirror in RTL. Falls back to the config.
positionMode'fixed' | 'absolute' | 'static''fixed'fixed pins to the viewport with max(offset, env(safe-area-inset-*)) on the touched edges, absolute pins to the nearest positioned ancestor, static leaves it in the flow. Fixed and absolute layers sit on --oge-z-fab (below windows, popups and modals).
size'xs' | 'sm' | 'md' | 'lg''md'FAB diameter 40 / 56 / 72 px (speed-dial actions 32 / 40 / 48 px).
severity'normal' | 'accent' | 'success' | 'warning' | 'danger''accent'Fill colour — the button severity vocabulary; normal is the page surface with a hairline.
offsetstring | undefined'16px'Gap to the pinned edges (any CSS length), written to the --oge-fab-offset knob; the safe-area inset stays its floor.
disabledbooleanfalseDisables the FAB.

Methods 4

Name Type Description
open(): voidvoidOpens the dial; focus stays where it is (the click and arrow-key paths move it into the menu).
close(): voidvoidCloses the dial.
toggle(): voidvoidToggles opened.
focus(): voidvoidMoves focus to the FAB.

Events 2

Name Type Description
itemClickOgeSpeedDialItemClickEventAn enabled action was activated (click, Enter or Space); the dial then closes and focus returns to the FAB.
openedChangebooleanImplicit output of the opened model — fires on open and close, any reason (press, Escape, Tab, outside press).

Types 7

Keyboard (WAI-ARIA APG menu button)

Name Type Description
Enter / Space / clickFABToggles the dial; opening moves focus to the first enabled action.
Arrow along the dial / backFABOpens with focus on the first (nearest) / last action (ogeSpeedDialToggleKey).
Arrows · Home · EndactionMove along the dial axis and wrap, skipping disabled actions (ogeSpeedDialItemKey, ogeSpeedDialNavIndex); horizontal dials mirror in RTL.
Escape / TabactionEscape closes and returns focus to the FAB; Tab closes and lets focus move on.
Name Type Description
OgeSpeedDialItem{ key: string | number; label: string; icon?: string; disabled?: boolean; severity?: OgeFabSeverity }One action; a disabled action is aria-disabled, inert to clicks and skipped by the arrows.
OgeSpeedDialItemClickEvent{ item: OgeSpeedDialItem; index: number; event: Event }Payload of itemClick.
OgeSpeedDialDirection / OgeSpeedDialOpenMode / OgeSpeedDialLabelModestring unionsThe vocabularies above, single-sourced in @oge-ui/behavior.

Buttons configuration

Methods 1

Name Type Description
provideOgeButtonsConfig(config: OgeButtonsConfigInput): ProviderProviderApplication- or component-scoped defaults; deep-merges messages over the defaults.

Types 15

OgeButtonsConfig

Name Type DefaultDescription
clickGuardMsnumber500Default window for clickGuard: true and guard options without ms.
holdToConfirmMsnumber800Default hold duration for holdToConfirm: true.
autoRepeatDelayMsnumber400Delay before autoRepeat starts repeating.
autoRepeatIntervalMsnumber80Interval between repeated clicks.
adaptiveMode'auto' | 'none''none'Default adaptiveMode of the drop-down button.
adaptiveBreakpointnumber600Viewport width (px) below which 'auto' opens the menu as a bottom sheet.
messagesOgeButtonsMessages—User-facing strings (see below).

OgeButtonsMessages

Name Type DefaultDescription
loadingstring'Loading'Screen-reader text announced while a button is busy.
holdToConfirmstring'Hold to confirm'Tooltip fragment when holdToConfirm is enabled.
dropDownLoadingstring'Loading…'Status row while a drop-down loads async items.
dropDownNoItemsstring'No items'Status row when a drop-down has no items.
dropDownLoadErrorstring'Could not load items'Status row when async items failed to load.
dropDownTogglestring'Open menu'Aria label of the split drop-down's chevron toggle.
adaptiveClosestring'Close'Aria label of the adaptive menu sheet's close button.
adaptiveTitlestring'Actions'Sheet title when the button has no text or hint.

FAB configuration

Properties 2

provideOgeFabConfig()

Name Type Description
messagesOgeFabMessagesEvery user-facing string: speedDial — the speed dial’s accessible name fallback (default Actions; fab slice of the locale packs).
position / positionMode / size / severity—Defaults for the matching inputs of both oge-fab and oge-speed-dial.

Notes

  • Outputs never reuse native DOM event names — bind (clicked), not (click); native events still bubble from the host and bypass every guard.
  • onInitialized/onOptionChanged/onContentReady lifecycle callbacks are intentionally absent — Angular lifecycle, effect() and signal inputs cover them.