# V toggle 4

> Toggle with button and icon

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-toggle-4).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-toggle-4
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-toggle-4-light-a1e52c5d23f4be78.png
- Registry item: https://ui.cnippet.dev/r/v-toggle-4.json
- Categories: toggle
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-toggle-4.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/toggle`

## Files

### `registry/default/variants/v-toggle-4.tsx`

```tsx
import { BoldIcon } from "lucide-react";
import { Button } from "@/registry/default/ui/button";
import { Toggle } from "@/registry/default/ui/toggle";

export function Pattern() {
  return (
    <div className="flex flex-col items-center justify-center gap-4">
      <div className="flex items-center gap-2">
        <Button size="sm" variant="outline">
          Button
        </Button>
        <Toggle aria-label="Small toggle" size="sm" variant="outline">
          Toggle
        </Toggle>
      </div>
      <div className="flex items-center gap-2">
        <Button size="icon" variant="outline">
          <BoldIcon />
        </Button>
        <Toggle aria-label="Toggle bold icon" variant="outline">
          <BoldIcon />
        </Toggle>
      </div>
    </div>
  );
}
```
