# Toggle group: Multiple

> `multiple` lets any number of items be on, like text formatting.

Example: https://hextaui.com/docs/toggle-group/examples/multiple
Component docs: https://hextaui.com/docs/toggle-group.md

## Add this example

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

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

## Source

```tsx title="components/examples/toggle-group/multiple.tsx"
import {
  IconBold,
  IconItalic,
  IconStrikethrough,
  IconUnderline,
} from "@tabler/icons-react"

import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

export function ToggleGroupMultiple() {
  return (
    <ToggleGroup
      multiple
      variant="outline"
      aria-label="Text formatting"
      defaultValue={["bold", "italic"]}
    >
      <ToggleGroupItem value="bold" aria-label="Bold">
        <IconBold />
      </ToggleGroupItem>
      <ToggleGroupItem value="italic" aria-label="Italic">
        <IconItalic />
      </ToggleGroupItem>
      <ToggleGroupItem value="underline" aria-label="Underline">
        <IconUnderline />
      </ToggleGroupItem>
      <ToggleGroupItem value="strikethrough" aria-label="Strikethrough">
        <IconStrikethrough />
      </ToggleGroupItem>
    </ToggleGroup>
  )
}
```

## Props in this example

### ToggleGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string[]` | – |  |
| `multiple` | `boolean` | `false` |  |
| `variant` | `"default" \| "outline"` | `"default"` | Sets every item's variant. |

### ToggleGroupItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | – | Identifies the item in the group's value. |

## More Toggle group examples

- [Outline](https://hextaui.com/docs/toggle-group/examples/outline.md)
- [Sizes](https://hextaui.com/docs/toggle-group/examples/sizes.md)
- [Spacing](https://hextaui.com/docs/toggle-group/examples/spacing.md)
- [Icons and labels](https://hextaui.com/docs/toggle-group/examples/icons.md)
- [Vertical](https://hextaui.com/docs/toggle-group/examples/vertical.md)
- [Disabled](https://hextaui.com/docs/toggle-group/examples/disabled.md)
- [Controlled](https://hextaui.com/docs/toggle-group/examples/controlled.md)
- [Right to left](https://hextaui.com/docs/toggle-group/examples/rtl.md)
