# Toggle: Filled when on

> Add `group-data-pressed/toggle:fill-current` to an outline icon and it fills in as the toggle turns on.

Example: https://hextaui.com/docs/toggle/examples/filled-icon
Component docs: https://hextaui.com/docs/toggle.md

## Add this example

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

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

## Source

```tsx title="components/examples/toggle/filled-icon.tsx"
import { IconBookmark, IconHeart, IconStar } from "@tabler/icons-react"

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

export function ToggleFilledIcon() {
  return (
    <div className="flex items-center gap-1">
      <Toggle aria-label="Like" defaultPressed>
        <IconHeart className="group-data-pressed/toggle:fill-current" />
      </Toggle>
      <Toggle aria-label="Star">
        <IconStar className="group-data-pressed/toggle:fill-current" />
      </Toggle>
      <Toggle aria-label="Save">
        <IconBookmark className="group-data-pressed/toggle:fill-current" />
      </Toggle>
    </div>
  )
}
```

## Props in this example

### Toggle

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultPressed` | `boolean` | `false` |  |

## More Toggle examples

- [Outline](https://hextaui.com/docs/toggle/examples/outline.md)
- [With text](https://hextaui.com/docs/toggle/examples/text.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)
