Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Actions Form-associated

Button <pm-button>

Button for actions, or a link styled as a button when href is set.

Full screen
Save changes Soft Outline Ghost Delete Saving Assign to Ada A

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/avatar'; import '@prismora/elements/button'; import '@prismora/elements/kbd'; import { registerIcons } from '@prismora/elements/icon'; import { plus } from '@prismora/icons'; registerIcons([plus]); </script> <pm-button icon-start="plus">Save changes</pm-button> <pm-button variant="soft">Soft</pm-button> <pm-button variant="outline" tone="neutral">Outline</pm-button> <pm-button variant="ghost">Ghost</pm-button> <pm-button tone="danger" variant="soft">Delete</pm-button> <pm-button loading>Saving</pm-button> <pm-button variant="outline" tone="neutral"> <pm-avatar slot="start" name="Ada Lovelace" size="xs"></pm-avatar> Assign to Ada <pm-kbd slot="end">A</pm-kbd> </pm-button>

Variants

Set with the variant attribute.

Save changes
variant="solid"
Save changes
variant="soft"
Save changes
variant="outline"
Save changes
variant="ghost"
Save changes
variant="link"

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

Save changes
size="xs"
Save changes
size="sm"
Save changes
size="md"
Save changes
size="lg"
Save changes
size="xl"

Tones

Set tone on the element, or data-tone on any ancestor to tone a whole area.

Save changes
tone="accent"
Save changes
tone="secondary"
Save changes
tone="neutral"
Save changes
tone="success"
Save changes
tone="warning"
Save changes
tone="danger"
Save changes
tone="info"

States

Each state is one attribute.

Save changes
Disabled
Save changes
Loading

Attributes

AttributeTypeDefaultDescription
icon-start
prop: iconStart
string—Registered icon name shown before the content (see registerIcons); a start slot overrides it.
icon-end
prop: 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'buttonNative type of the underlying control.
disabledbooleanfalseNot interactive (and not submitted, for form controls).
loadingbooleanfalseShows a spinner and blocks interaction while keeping the width.
iconbooleanfalseSquare icon-only button. Requires label.
hrefstring—Renders an <a> instead of a <button>.
targetstring—Where an href link opens (as on <a>); _blank adds rel="noopener".
labelstring—Accessible name (required for icon-only buttons).
namestring—Form field name: the value is submitted under it.
valuestring—Current value.
commandforstring—id of the element to control (same tree).
commandstring—Command sent to commandfor: built-ins (show-modal, close, toggle-popover…) or custom --name.
popovertargetstring—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

SlotDescription
(default)Label.
startLeading icon.
endTrailing icon.

CSS parts

PartDescription
::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