CountBadge
Red numeric badge for unread counts.
Code
import * as React from 'react';
import { CountBadge } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
display: 'flex',
gap: 8,
}}
>
<CountBadge count={3} />
<CountBadge count={120} />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { CountBadge } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/count-badge.jsonGuidelines
- Caps at
max(99+). Give it alabellike "3 unread".
Props
| Prop | Type | Required |
|---|---|---|
count | number | Yes |
max | number | No |
label | string | No |
className | string | No |