# V button 21

> Button with an unread badge

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-button-21.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/button`

## Files

### `registry/default/variants/v-button-21.tsx`

```tsx
import { MailIcon } from "lucide-react";
import { Badge } from "@/registry/default/ui/badge";
import { Button } from "@/registry/default/ui/button";

export function Pattern() {
  return (
    <Button
      aria-label="Inbox (8 unread)"
      className="relative gap-2"
      variant="outline"
    >
      <MailIcon aria-hidden="true" />
      Inbox
      <Badge
        aria-hidden="true"
        className="absolute -top-1.5 -right-2 rounded-full px-1"
        size="sm"
        variant="destructive"
      >
        8
      </Badge>
    </Button>
  );
}
```
