Badges are small, circular containers used to decorate other components with glancable information.
You should have the chayns-components
package installed. If that is not the
case already, run
yarn add chayns-components
or
npm i chayns-components
After the chayns-components
package is installed, you can import the component
and use it with React:
import React from 'react'
import { Badge } from 'chayns-components';
// ...
<Badge {...} />
The Badge
-component takes the following props:
Name | Type | Default | Required |
---|---|---|---|
children | ReactNode |
✓ | |
className | string |
||
style | { [key: string]: string | number } |
||
badgeRef | function |
children: ReactNode;
A React node that is displayed inside of the Badge.
className?: string
A classname that is applied to the Badge <div>
-element.
style?: { [key: string]: string | number }
A React style object that will be applied to the Badge <div>
-element.
badgeRef?: function
Retrieves the ref to the Badge <div>
-element.