OGE logoOGE

Buttons

<oge-button> is a token-themed action button with semantic severities, three fill styles, badges and gesture superpowers (async actions, click guarding, hold-to-confirm, auto-repeat — see the Interactions page). Bind (clicked) for the guarded pipeline; every state is driven by design tokens, so dark mode and the bridge themes work out of the box.

severity stylingMode size badge hint useSubmitBehavior

Severities & styling modes

Five semantic severities (normal, accent, success, warning, danger) map straight to the design tokens, so every theme restyles them automatically. Each severity combines with three fill styles — contained (solid, the default), outlined and text — giving you the full action hierarchy of a page from one component.

severity stylingMode: contained | outlined | text

Sizes

Three presets — sm (28px), md (34px, default) and lg (42px). The scale is shared with the input editors, so a button placed next to a text box of the same size lines up pixel-perfect in form rows.

size: sm | md | lg

Icons

There is no icon-font dependency: project any inline SVG with the ogeButtonIcon attribute and it inherits the button's color. iconPosition places it before or after the label. Icon-only buttons must provide an accessible name via ariaLabel (or a hint tooltip).

[ogeButtonIcon] projection iconPosition

Custom colors

The color input accepts any CSS color and overrides the severity palette for that one button — the hover shade and focus ring derive automatically. For brand-wide changes, override the --oge-* tokens instead: globally, per theme file, or inline on a single element.

[color] input per-instance token override

Badges

A number or string renders a pill in the button's corner; numbers cap at 99+. The value joins the button's accessible name through a visually hidden span, so screen readers announce it. Passing true renders a plain attention dot instead.

badge: number | string | true (dot) 99+ capping

Notes

  • Bind (clicked), not native (click) — only the component output goes through clickGuard, the gestures and the single-flight action protection.
  • useSubmitBehavior renders type="submit" so the button submits its enclosing form; the default is always type="button".
  • Numeric badges join the accessible name via a visually hidden span; the dot variant is decorative (aria-hidden).
  • RTL needs no configuration — layout uses logical properties and follows the surrounding dir attribute.