webflow svelte components logoWFS

Button

Interactive element that initiates an action, with a label or icon describing the outcome.

API Reference

Usage

<script lang="ts">
  import { Button } from '$lib/components/button';
</script>
<Button variant="primary">Button</Button>

Properties

The Button component extends the Bits UI <Button> component. Find the full list of available properties in the official Bits UI documentation.

Button

PropTypeDefault
variant
string
default
disabled
boolean
false
loading
boolean
false
leadingIcon
ComponentType
-
trailingIcon
ComponentType
-

ButtonIcon

PropTypeDefault
variant
string
default
size
string
medium
disabled
boolean
false
loading
boolean
false

Examples

Variants

Use the variant property to change the appearance of the button.

Disabled

Use the disabled property to disable the button.

Loading

Use the loading property to show a loading indicator.

Icon support

Use the leadingIcon and trailingIcon properties to add an icon to the button.

Button icon

Use the ButtonIcon component to create icon-only buttons.

Button icon size

Use the size property to change the size of the button icon.

Use the href property to create a link button.

On this page