> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/huntabyte/shadcn-svelte/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle

> A two-state button that can be either on or off.

## Installation

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    npx shadcn-svelte@next add toggle
    ```
  </Tab>

  <Tab title="Manual">
    <Steps>
      <Step title="Install bits-ui">
        ```bash theme={null}
        npm install bits-ui -D
        ```
      </Step>

      <Step title="Copy and paste the component source">
        Copy and paste the component source code into your project.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Usage

```svelte theme={null}
<script lang="ts">
  import { Toggle } from "$lib/components/ui/toggle/index.js";
</script>
```

```svelte theme={null}
<Toggle>Toggle</Toggle>
```

## Examples

### Default

Basic toggle button.

### Outline

Toggle with outline variant.

### With Text

Toggle button with text label.

### Small

Smaller toggle button size.

### Large

Larger toggle button size.

### Disabled

Disabled toggle button state.

## Links

* [Source](https://github.com/huntabyte/shadcn-svelte/tree/next/sites/docs/src/lib/registry/ui/toggle)
* [Bits UI Documentation](https://bits-ui.com/docs/components/toggle)
* [API Reference](https://bits-ui.com/docs/components/toggle#api-reference)
