Skip to content

Components

Badge

A small glass badge with its text flowing through the lens.

Markdown
glass-badge-basic.tsx

Autumn update

Sliders, switches and checkboxes, now in refractive glass.

New

Use it for

  • One short word on a card or a tab: New, Beta, Live.

Not for

  • Counts or status that must be read at a glance: the text is moving.
  • Several on one screen: the motion competes.

Installation

Coming soon
npm install @vitrumui/react
No dependencies

Usage

app.tsx
import { GlassBadge } from '@vitrumui/react/badge'

<div className="relative">
  <Card />
  <GlassBadge className="absolute -top-2 -right-2">New</GlassBadge>
</div>

Behaviour

The text is drawn beneath the glass, so the rim bends the letters as they pass. Whatever sits behind the badge shows through, softly blurred. Hovering the badge's positioned parent speeds the flow up. Colour it with bg-* and text-*.

Examples

Coming soon

API reference

PropTypeDefault
children

The text: one short word.

string—
dotColor

Separator colour between repeats.

stringcurrentColor
speed

Loops per second at rest.

number0.4
tint

Opacity of the badge colour over the backdrop.

number0.82
className

Position and colour (bg-*, text-*).

string—

Accessibility

  • The text is announced once, not as a loop.
  • With reduced motion the text stands still, centred.