<a id="toggle"></a>

## Toggle  
**Category**: Data Input
Switch control for boolean input states
### Examples

#### Basic Toggle  
```python
Input(type='checkbox', checked=True, cls='toggle')
```

#### Color Variants  
```python
Input(type='checkbox', checked=True, cls='toggle toggle-primary'),
Input(type='checkbox', checked=True, cls='toggle toggle-secondary'),
Input(type='checkbox', checked=True, cls='toggle toggle-accent'),
Input(type='checkbox', checked=True, cls='toggle toggle-neutral'),
Input(type='checkbox', checked=True, cls='toggle toggle-info'),
Input(type='checkbox', checked=True, cls='toggle toggle-success'),
Input(type='checkbox', checked=True, cls='toggle toggle-warning'),
Input(type='checkbox', checked=True, cls='toggle toggle-error'),
```

#### Disabled States  
```python
Input(type='checkbox', disabled=True, cls='toggle'),
            Input(type='checkbox', disabled=True, checked=True, cls='toggle'),
```

#### Toggle with Icons  
```python
Label(
    Input(type='checkbox'),
    NotStr("<svg aria-label='enabled' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g stroke-linejoin='round' stroke-linecap='round' stroke-width='4' fill='none' stroke='currentColor'><path d='M20 6 9 17l-5-5'></path></g></svg>"),
    NotStr("<svg aria-label='disabled' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>"),
    cls="toggle text-base-content",
)
```

#### Custom Color  
```python
Input(type='checkbox', checked=True, 
    cls='toggleborder-indigo-600 bg-indigo-500 checked:bg-orange-400 checked:text-orange-800 checked:border-orange-500')
```

#### Indeterminate State  
```python
<!-- You can make a checkbox indeterminate using JS -->
Input(type='checkbox', id='my-toggle', cls='toggle', onclick="event.preventDefault()"),
Script('document.getElementById("my-toggle").indeterminate = true')
```

#### With Fieldset and Labels  
```python
Fieldset(
    Legend("Login options", cls='fieldset-legend'),
    Label(
        Input(type='checkbox', checked=True, cls='toggle'),
        "Remember me",
        cls='fieldset-label'
    ),
    cls='fieldset p-4 bg-base-100 border border-base-300 rounded-box w-64'
)
```

#### Size Variants  
```python
Input(type='checkbox', checked=True, cls='toggle toggle-xs'),
Input(type='checkbox', checked=True, cls='toggle toggle-sm'),
Input(type='checkbox', checked=True, cls='toggle toggle-md'),
Input(type='checkbox', checked=True, cls='toggle toggle-lg'),
Input(type='checkbox', checked=True, cls='toggle toggle-xl'),
```

