# Light Badge

> A badge lit from below by a rotating gradient stroke and soft rays.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Avatars & Badges |
| Live preview | https://uibrik.com/components/light-badge |
| Writes | 2 files into `components/uibrik/light-badge/` |
| Packages | none beyond React |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 12, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/light-badge.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/light-badge`.

Can't run commands? https://uibrik.com/components/light-badge/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { GradientStrokePill } from "@/components/uibrik/light-badge/GradientStrokePill";

<GradientStrokePill
  hover
  follow
  stroke={1.5}
  radius={16}
  ray={0.55}
  inner={0.5}
  rayLength={11}
  period={3.6}
  hoverIntensity={0.4}
  hoverSpeed={0.45}
  followStrength={0.3}
  followRange={220}
  castOn={null}
  // colors={["…"]}
>
  New
</GradientStrokePill>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/light-badge.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `hover` | `boolean` | `true` | Brighten and speed up while hovered. |
| `follow` | `boolean` | `true` | The light leans toward a nearby pointer. |
| `stroke` | `number` | `1.5` | Stroke width. |
| `radius` | `number` | `16` | Corner radius. |
| `ray` | `number` | `0.55` | Strength of the light rays under the badge. |
| `inner` | `number` | `0.5` | Strength of the inner waves. |
| `rayLength` | `number` | `11` | How far the rays fall. |
| `period` | `number` | `3.6` | Seconds per 360° turn of the stroke gradient. |
| `hoverIntensity` | `number` | `0.4` | How much brighter the light gets while hovered (0.4 = 40%). |
| `hoverSpeed` | `number` | `0.45` | How much faster the waves run while hovered (0.45 = 45%). |
| `followStrength` | `number` | `0.3` | How far the light leans toward the cursor, as a share of the way. |
| `followRange` | `number` | `220` | How near the cursor must be for the light to notice it. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` (required) | `ReactNode` |  | Badge content. |
| `colors` | `string[]` |  | Stroke gradient stops, e.g. one of the Colours presets. |
| `castOn` | `RefObject<HTMLCanvasElement>` |  | Canvas below (see LightCatcher) that catches the light. |
| `className` | `string` |  | Classes for the badge. |

## Where it fits

- **Plan and role highlights**: A rotating gradient stroke marks a recommended plan or an admin role. Pairs with [Pricing Glow](https://uibrik.com/components/pricing-glow.md) (Pro).
- **New and Pro labels**: Soft rays from below make a small badge noticeable without being loud. Pairs with [Announcement Pill](https://uibrik.com/components/announcement-pill.md).
- **Premium features**: A lit badge next to a feature name signals it belongs to a paid tier.

## Same shelf: Avatars & Badges

- [Social Avatar](https://uibrik.com/components/social-avatar.md): An avatar that fans the person's social accounts out of itself along an arc, with real brand logos that copy the handle or open the profile on press.
- [Status Badge](https://uibrik.com/components/status-badge.md): One status pill that moves between states: the tint eases to the new colour, the icon turns in, the label rolls and the pill glides to its new width.
- [Story Ring](https://uibrik.com/components/story-ring.md): An avatar in a segmented story ring that spins into dashes while a story loads, then drains the arc you opened to grey.
- [Tech Stack](https://uibrik.com/components/tech-stack.md): A row of real brand logos for the tools behind a product that open into tinted pills naming each one as neighbours slide aside.
- [Verified Badge](https://uibrik.com/components/verified-badge.md): A scalloped verified seal in blue, gold or grey that stamps in with a turn, draws its check and catches one pass of light.
- [Account Switcher](https://uibrik.com/components/account-switcher.md) (Pro): An account switcher whose trigger is a stack of faces: picking an account deals its face to the front while the name rolls over and a check lands.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/light-badge/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
