Installation
yarn add @react-spectre/badge
npm install @react-spectre/badge --save
Usage
Badges
There is 1 single component used for badges: Badge
.
import { Badge } from '@react-spectre/badge'
Badges are used as wrapper components with the label property (this property is optional, badge will appear empty if the label is not specified). You can use badge for span, buttons and figures.
<Badge label={1}>
<span>Notifications</span>
</Badge>
<Badge label={2}>
<Button>Badge Button</Button>
</Badge>
<Badge label={11}>
<Figure className="avatar">
<Image
responsive
src="https://picturepan2.github.io/spectre/img/avatar-1.png"
/>
</Figure>
</Badge>