Button

The Button component is used to trigger actions, submit forms, or navigate users through primary, secondary, and default button variants.

Buttons of type basic

The basic button has no background or border. The text color is determined by the color property. This button also lacks padding left and right.

Primary (href)

Buttons of type outlined

Outlined buttons consist of a border colored by the color property. The content(icon/text) will also be colored by the color property.

Primary outlined

Type filled

Buttons with type filled and in three different colors.

Primary filled

Full width buttons

By setting the fullWidth attribute to true, the button will stretch to fill the width of its container.

Primary full width


Primary full width (ico)

Buttons with both text and icon

You can choose to have both text and an icon. You can also switch positions of the text and icon by setting reverse to true.




Button with icon only

This is a button with only an icon. This is the only button that will be rendered as a square.

Button with icon only - sizes

Visual alignment modifier

Use the c-button--align-visually modifier on basic icon-only buttons when the hover area should extend outside the layout without shifting the icon alignment. The bordered wrapper below makes the negative inline spacing visible.

Size

Different sizes ranging from sm to lg

Size with icons

Different sizes ranging from sm to lg with icons

Disabled buttons

A button with the data-attribute disabled set to true will be greyed out and cursor set to not-allowed.

Togglebuttons

When pressing a toggle-button the text color will go from black to primary to indicate it being toggled.

Basic buttons

Filled buttons

Outline buttons

Togglebuttons with interchangable labels and icons

When pressing a toggle-button label and/or the icon will be changed to indicate the action.

Toggle buttons with interchangable labels & icons

Type

Use the type attribute to help define the action of the button.

Pill-shaped buttons

By setting the pill attribute to true, the button will have a border-radius of 9999px, making it pill-shaped.

Primary (href)
Primary (href)
Primary (href)

API

Parameter Default Type Description
null ?string The visible label.
md string The button size.
default string The button color scheme.
button string The HTML button type.
filled string The visual button style.
normal string The visual button shape.
null ?string The optional link target.
_top string The link target attribute.
button string The rendered wrapper element.
span string The element used around the label.
true boolean Whether the ripple effect is enabled.
false string|boolean The pressed state value.
false boolean Whether the button behaves like a toggle.
null ?string The optional icon name.
false boolean Whether icon and text positions are reversed.
false boolean Whether the button should stretch to full width.
[] array Extra icon classes.
[] array Extra text classes.
string The aria-label value.
true boolean Whether disabled color handling is active.

CSS API

Variable Default Type Values Description
var(--base) range - Main unit that drives radius and spacing scales.
var(--border-radius) range - Border Radius
var(--border-width) range - Size
var(--space) range - Base spacing unit. Used for padding and margin inside components.
var(--outer-space) range - Spacing between components. Use --space for spacing inside components.
var(--color--primary) color - Controls the background, text, border, hover, and active colors for primary buttons.
var(--color--secondary) color - Controls the background, text, border, hover, and active colors for secondary buttons.
var(--font-weight-medium) select 100, 200, 300, 400, 500, 600, 700, 800, 900 Medium Weight
var(--font-family-base) font - Body Font
var(--color--surface) color - Controls the background, text, border, hover, and active colors for default buttons.
var(--color--surface-contrast) color - Used for text and icons on surface backgrounds with less contrast.
var(--shadow-color) rgba - Shadow Color
var(--shadow-amount) range - Multiplier for elevation shadows. 0 = none, 1 = default.
var(--color--primary-contrast) color - Primary Contrast
var(--color--primary-border) color - Manual companion token for primary border and hover states.
var(--color--secondary-contrast) color - Secondary Contrast
var(--color--secondary-border) color - Manual companion token for secondary border and hover states.
var(--color--surface-border) color - Manual companion token for borders on surface elements.
var(--color--surface-alt) color - Manual companion token for subtle surface backgrounds.
var(--corner-shape) select square, round, squircle, circular, bevel, scoop Corner Shape
var(--font-size-90) range - One step below base in the type scale.
var(--font-size-100) range - Base font size.
var(--font-size-200) range - One step above base in the type scale. Equivalent to h6/subtitle.