Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Button

Actions with consistent tone, appearance and interaction states.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Variants

Semantic meaning carried by each button tone.

Open preview

Appearances

The same semantic tone, from solid to fully transparent.

Open preview

Sizes

A consistent scale from xs to xxl.

Open preview

Usage

Use Button for an action and Link for navigation. The default button type is button; set type=submit deliberately inside a form.

The example enumerates appearances from buttonVariantMap. loading disables the control and announces aria-busy; provide text that still explains the action.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

ButtonProps

Type source
ButtonProps public API
NameTypeDefaultDescription
loadingboolean | undefinedfalseShow the busy state and prevent activation.
startIconReactNode—Decorative content before the label or input.
endIconReactNode—Decorative content after the label or input.
fullWidthboolean | undefinedfalseUse the available width of the parent.
iconOnlyboolean | undefinedfalseRender an icon-only action. Provide an accessible name with aria-label.
disabledboolean | undefined—Standard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
type"submit" | "reset" | "button" | undefined"button"Standard React/HTML attribute.
valuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined""Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLButtonElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLButtonElement> | undefined—Standard React/HTML attribute.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined"primary"Variant exposed by this component.
appearance"solid" | "soft" | "outline" | "ghost" | "link" | "dashed" | "glass" | "elevated" | "glow" | "text" | undefined"solid"Visual treatment of the control or surface.
size"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined"md"Component size.
radius"sm" | "md" | "lg" | "none" | "full" | undefined"md"Corner-radius treatment.
loading

boolean | undefined

Default: false

Show the busy state and prevent activation.

startIcon

ReactNode

No default extracted.

Decorative content before the label or input.

endIcon

ReactNode

No default extracted.

Decorative content after the label or input.

fullWidth

boolean | undefined

Default: false

Use the available width of the parent.

iconOnly

boolean | undefined

Default: false

Render an icon-only action. Provide an accessible name with aria-label.

disabled

boolean | undefined

No default extracted.

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

type

"submit" | "reset" | "button" | undefined

Default: "button"

Standard React/HTML attribute.

value

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

Default: ""

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLButtonElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLButtonElement> | undefined

No default extracted.

Standard React/HTML attribute.

variant

"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined

Default: "primary"

Variant exposed by this component.

appearance

"solid" | "soft" | "outline" | "ghost" | "link" | "dashed" | "glass" | "elevated" | "glow" | "text" | undefined

Default: "solid"

Visual treatment of the control or surface.

size

"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined

Default: "md"

Component size.

radius

"sm" | "md" | "lg" | "none" | "full" | undefined

Default: "md"

Corner-radius treatment.

Accessibility

  • Keep a visible label, or give an icon-only action an aria-label.
  • Disabled and loading controls cannot be activated. Do not put essential explanations only on a disabled control.
Read the accessibility guide →