# Toggle (@limerdev/zest) A button that stays pressed until pressed again (`bind:pressed`), announced as pressed or not. `variant` (`default`, `outline`) and `size` (`sm`, `default`, `lg`) as for buttons. - Category: Actions - Import: `import { Toggle, toggleVariants } from '@limerdev/zest'` - Bits UI: `Toggle`, https://bits-ui.com/docs/components/toggle - Exports: `Toggle`, `toggleVariants` - Use for: One on/off formatting or view option in a toolbar: bold, show grid, pin. - Don't: A setting in a form or settings page: use `Switch` or `Checkbox`. Several related toggles: use `ToggleGroup`. A toggle without a name: label icon-only ones with `aria-label`. ```svelte ``` Props of `Toggle`: - `disabled` (`null | false | true`, default `false`): Whether the toggle is disabled or not. - `onPressedChange` (`OnChangeFn`): A callback function called when the toggle is pressed. - `pressed` (`boolean`, default `false`, bindable): Whether the toggle is pressed or not. - `size` (`"default" | "sm" | "lg"`, default `'default'`): The height and padding, from the theme's field size. - `variant` (`"outline" | "default"`, default `'default'`): `default` is plain until pressed; `outline` has a border. Example: Basic Toggles stay pressed. Name icon-only ones with aria-label. ```svelte Billable only Archived ```