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 24

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.
tabIndexnumber0Tab order of the native button.
accessKeystring | undefined—Native accesskey of the inner button.
messagesPartial&lt;OgeButtonsMessages&gt; | 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&lt;boolean&gt;Read-only computed: disabled, busy, or inside a disabled group.

Events 4

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.

Types 11

Name Type Description
OgeButtonStylingMode'contained' | 'outlined' | 'text'Fill style.
OgeButtonSeverity'normal' | 'accent' | 'success' | 'warning' | 'danger'Semantic color mapped to the severity tokens.
OgeButtonSize'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&lt;readonly string[]&gt;[]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 21

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(() =&gt; unknown) | undefined—Async click handler of the split main button (single-flight, drives loading).
clickGuardboolean | OgeClickGuardOptionsfalseClick guard of the split main button.
loadingmodel&lt;boolean&gt;falseBusy state of the (main) button — two-way.
messagesPartial&lt;OgeButtonsMessages&gt; | 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&lt;boolean&gt;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.
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&lt;OgeMenuItemTemplateContext&gt; | 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() =&gt; readonly OgeMenuItem[] | Promise&lt;readonly OgeMenuItem[]&gt;Lazy items factory — invoked on first open.
OgeDropDownButtonItemClickEvent{ item: OgeMenuItem; index: number; event: MouseEvent | KeyboardEvent }Index within the resolved items list (separators included).
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.

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.

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.