# Toggle: With text

> Icons and labels sit side by side. Toggles with visible text don't need an aria-label.

Example: https://hextaui.com/docs/toggle/examples/text
Component docs: https://hextaui.com/docs/toggle.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/toggle-text.json
```

This adds `components/examples/toggle/text.tsx` with the Toggle component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/toggle/text.tsx"
import { IconItalic, IconTextWrap } from "@tabler/icons-react"

import { Toggle } from "@/components/ui/toggle"

export function ToggleText() {
  return (
    <div className="flex flex-wrap items-center gap-2">
      <Toggle>
        <IconItalic />
        Italic
      </Toggle>
      <Toggle variant="outline" defaultPressed>
        <IconTextWrap />
        Wrap lines
      </Toggle>
      <Toggle variant="outline">Show hidden files</Toggle>
    </div>
  )
}
```

## Props in this example

### Toggle

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"default" \| "outline"` | `"default"` |  |
| `defaultPressed` | `boolean` | `false` |  |

## More Toggle examples

- [Outline](https://hextaui.com/docs/toggle/examples/outline.md)
- [Filled when on](https://hextaui.com/docs/toggle/examples/filled-icon.md)
- [Sizes](https://hextaui.com/docs/toggle/examples/sizes.md)
- [Pill](https://hextaui.com/docs/toggle/examples/pill.md)
- [Disabled](https://hextaui.com/docs/toggle/examples/disabled.md)
- [Controlled](https://hextaui.com/docs/toggle/examples/controlled.md)
- [Right to left](https://hextaui.com/docs/toggle/examples/rtl.md)
