# P button 26

> Star button with count badge

A shadcn/ui block from the [@coss](https://coss.com/ui) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/coss/p-button-26).

- Page, with a live preview: https://shadcn.exchange/r/coss/p-button-26
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/coss/p-button-26-light-84ba2fadcdc87d13.png
- Registry item: https://coss.com/ui/r/p-button-26.json
- Categories: button
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://coss.com/ui/r/p-button-26.json
```

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

## Dependencies

- npm packages: `lucide-react`
- Registry items: `@coss/button`

## Files

### `registry/default/particles/p-button-26.tsx`

```tsx
"use client";

import { StarIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/registry/default/ui/button";

export default function Particle() {
  const [isStarred, setIsStarred] = useState(false);
  const count = isStarred ? 730 : 729;

  return (
    <Button onClick={() => setIsStarred(!isStarred)}>
      <StarIcon
        aria-hidden="true"
        className={`${isStarred ? "fill-yellow-500 text-yellow-500" : undefined}`}
      />
      <span className="flex items-baseline gap-2">
        {isStarred ? "Starred" : "Star"}
        <span className="text-primary-foreground/60 text-xs">{count}</span>
      </span>
    </Button>
  );
}
```
