# Button A clickable element that triggers an action when pressed. ## Usage Use standalone. ```svelte ``` ## Anatomy The `class` attribute values represent part names, and `conditional` indicates elements that are rendered conditionally. Other attributes represent their corresponding props. ```svelte ``` ## Props | Name | Type | Default | Description | |---|---|---|---| | `children*` | `Snippet` | - | Main label; receives the variant as its argument | | `left` | `Snippet` | - | Content before the label | | `right` | `Snippet` | - | Content after the label | | `type` | `` | `"button"` | The button's `type` attribute | | `onclick` | `MouseEventHandler` | - | Click handler; suppressed while `inactive` is set | | `form` | `HTMLFormElement` | - | Form validated on click ([Details](/docs/form-controls#form-wide-validation)) | | `inactive` | `string` | - | Non-empty reason marks `aria-disabled`, suppresses `onclick`, and forces the `inactive` variant (restored when cleared) | | `attach` | `Attachment` | - | Svelte attachment on the root button | | `element` | `HTMLButtonElement` | - | Bindable root element | | `styling` | `SVSClass` | - | Styling override | | `variant` | `SVSVariant` | `NEUTRAL` | Bindable variant | `*` required. Other `HTMLButtonAttributes` are passed to ` ``` ### With Interactive Variant **Code** ```svelte src=ButtonPract.svelte ```