Badge
Small status label; tone pairs color with a word.
Code
import * as React from 'react';
import { Badge, CountBadge } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
display: 'flex',
gap: 8,
flexWrap: 'wrap',
}}
>
<Badge tone="accent">New</Badge>
<Badge tone="success" dot>
Active
</Badge>
<Badge tone="warning" dot>
Review
</Badge>
<Badge tone="danger" dot>
Blocked
</Badge>
<Badge>Draft</Badge>
<CountBadge count={3} label="3 unread" />
</div>
);
}Order states
import { Badge } from '@fruit-labs/design';
export default function Example() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 12, alignItems: 'center' }}>
<Badge tone="success" dot>Paid</Badge>
<Badge tone="warning" dot>Pending</Badge>
<Badge tone="danger" dot>Refunded</Badge>
<Badge tone="accent">New</Badge>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Badge } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/badge.jsonGuidelines
- Status must be readable without color: always write the status word.
dotadds a leading dot for list/table statuses.
Props
| Prop | Type | Required |
|---|---|---|
tone | 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | No |
dot | boolean | No |
className | string | No |
children | React.ReactNode | No |