Button
A clickable action. Eight hues, five sizes, ghost and danger modes, optional loading and icon.
Basic usage
Example
Hues
Sizes
States
Link button
Pass an href to render an <a> styled like a button.
Example
Accessibility
- Always has a
<button>(or<a>ifhref) — never a<div>. aria-busyis set duringloading.disabledremoves from the tab order and prevents click handlers.
API
Props
| Name | Type | Default | Description |
|---|---|---|---|
label | string | undefined | Visible label. Override with the default slot for richer content. |
hue | EpHue | "primary" | Semantic hue. |
size | EpSize | undefined | Size. Falls back to `<EpConfigProvider size>`, then `"md"`. |
ghost | boolean | false | Ghost / outline style. |
danger | boolean | false | Force the destructive (error) palette regardless of `hue`. |
block | boolean | false | Render full-width. |
loading | boolean | false | Show a spinner and ignore clicks. |
disabled | boolean | false | Disable interaction. |
htmlType | union | "button" | `<button>` `type` attribute. Ignored when `href` is set. |
href | string | undefined | When set, the component renders as an `<a>` instead of a `<button>`. |
target | union | undefined | Anchor target. Auto-applies `rel="noopener noreferrer"` for `_blank`. |
icon | string | undefined | Icon name (resolved by `SVGIcon`). Prefer the `#icon` slot. |
iconPosition | EpPosition | "after" | Position of the icon relative to the label. |
Events
| Event | Payload | Description |
|---|---|---|
click | {"names":["MouseEvent"]} | — |
Slots
| Slot | Scope | Description |
|---|---|---|
icon | — | — |
default | — | — |
