Button <pm-button>
Button for actions, or a link styled as a button when href is set.
Variants
Set with the variant attribute.
variant="solid"variant="soft"variant="outline"variant="ghost"variant="link"Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="xs"size="sm"size="md"size="lg"size="xl"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"States
Each state is one attribute.
DisabledLoadingAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
icon-startprop: iconStart | string | — | Registered icon name shown before the content (see registerIcons); a start slot overrides it. |
icon-endprop: iconEnd | string | — | Registered icon name shown after the content (see registerIcons); an end slot overrides it. |
variant | 'solid' | 'soft' | 'outline' | 'ghost' | 'link' | — | Visual style. Theme default: --pm-default-button-variant. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | — | Size: xs, sm, md, lg or xl (md when not set). |
type | 'button' | 'submit' | 'reset' | button | Native type of the underlying control. |
disabled | boolean | false | Not interactive (and not submitted, for form controls). |
loading | boolean | false | Shows a spinner and blocks interaction while keeping the width. |
icon | boolean | false | Square icon-only button. Requires label. |
href | string | — | Renders an <a> instead of a <button>. |
target | string | — | Where an href link opens (as on <a>); _blank adds rel="noopener". |
label | string | — | Accessible name (required for icon-only buttons). |
name | string | — | Form field name: the value is submitted under it. |
value | string | — | Current value. |
commandfor | string | — | id of the element to control (same tree). |
command | string | — | Command sent to commandfor: built-ins (show-modal, close, toggle-popover…) or custom --name. |
popovertarget | string | — | id of a popover to toggle (like the native attribute). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | Label. |
start | Leading icon. |
end | Trailing icon. |
CSS parts
| Part | Description |
|---|---|
::part(base) | The native button / anchor. Invokes other elements like a native button: commandfor + command (--open, --close, --toggle, show-modal, close, toggle-popover, …) or popovertarget. |
Used in templates
Overview dashboardTraffic analyticsOrdersCustomer 360InboxTeam chatAI assistantNotificationsProject boardTeam and rolesBilling and invoicesUser profileAccount settingsSign inCreate accountTwo-step verificationForgot passwordChoose a new passwordPricing plansProduct pageShopping cartCheckoutLanding pageArticleChangelogHelp centreContactComing soonNot found (404)Server error (500)Onboarding wizardAppointment bookingFeedback survey