Skip to content

Latest commit

 

History

History
84 lines (55 loc) · 1.64 KB

badge.md

File metadata and controls

84 lines (55 loc) · 1.64 KB

Badge

Source

Badges are small, circular containers used to decorate other components with glancable information.

Usage

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 {...} />

Props

The Badge-component takes the following props:

Name Type Default Required
children ReactNode
className string
style { [key: string]: string | number }
badgeRef function

children

children: ReactNode;

A React node that is displayed inside of the Badge.


className

className?: string

A classname that is applied to the Badge <div>-element.


style

style?: { [key: string]: string | number }

A React style object that will be applied to the Badge <div>-element.


badgeRef

badgeRef?: function

Retrieves the ref to the Badge <div>-element.