Badge
The Badge component from Superset's UI library.
Live Example
Loading component...
Try It
Edit the code below to experiment with the component:
Live Editor
function Demo() { return ( <Badge count={5} size="default" overflowCount={99} /> ); }
Result
Loading...
Status Badge
Live Editor
function StatusBadgeDemo() { const statuses = ['default', 'success', 'processing', 'warning', 'error']; return ( <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}> {statuses.map(status => ( <Badge key={status} status={status} text={`Status: ${status}`} /> ))} </div> ); }
Result
Loading...
Color Gallery
Live Editor
function ColorGallery() { const colors = ['pink', 'red', 'orange', 'green', 'cyan', 'blue', 'purple']; return ( <div style={{ display: 'flex', gap: 16, flexWrap: 'wrap' }}> {colors.map(color => ( <Badge key={color} count={9} color={color} /> ))} </div> ); }
Result
Loading...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | 5 | Number to show in the badge. |
size | string | "default" | Size of the badge. |
showZero | boolean | false | Whether to show badge when count is zero. |
overflowCount | number | 99 | Max count to show. Shows count+ when exceeded (e.g., 99+). |
Import
import { Badge } from '@superset/components';
Improve this page
This documentation is auto-generated from the component's Storybook story. Help improve it by editing the story file.