Skip to content

wc-button

apps/docs/src/content/docs/component-library/wc-button Click to copy
Copied! apps/docs/src/content/docs/component-library/wc-button
<wc-button>

Primary interactive element for triggering actions.

A button component for user interaction.

Primary, secondary, and ghost visual styles.

Variants

PrimarySecondaryGhost

Small, medium, and large button sizes.

Sizes

SmallMediumLarge

Buttons in disabled state across all variants.

Disabled

PrimarySecondaryGhost

Full variant × size matrix.

All Combinations

Primary SMPrimary MDPrimary LGSecondary SMSecondary MDSecondary LGGhost SMGhost MDGhost LG

Properties

4
AttributeTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost''primary'Visual style variant of the button.
size'sm' | 'md' | 'lg''md'Size of the button.
disabledbooleanfalseWhether the button is disabled.
type'button' | 'submit' | 'reset''button'The type attribute for the underlying button element.

Events

1
NameTypeDescription
wc-clickCustomEventDispatched when the button is clicked (not disabled).

Slots

1
NameDescription
(default)Default slot for button label text or content.

CSS Custom Properties

7
PropertyDescription
--wc-button-bgButton background color.
--wc-button-colorButton text color.
--wc-button-border-colorButton border color.
--wc-button-border-radiusButton border radius.
--wc-button-font-familyButton font family.
--wc-button-font-weightButton font weight.
--wc-button-focus-ring-colorFocus ring color.

CSS Parts

1
PartDescription
buttonThe native button element.