Tabler React 2 Docs
Ribbons
Ribbons
You can assign a ribbon to a card to display a small badge.
Signature
import { Ribbon } from "tabler-react-2";
<Ribbon {...props}>{children}</Ribbon>;
Props
Prop | Required | Type | Default | Description |
---|---|---|---|---|
variant | No | Color | primary | The color variant of the ribbon. |
color | No | Color | The color variant of the ribbon. Alias of variant | |
content | No | React.ReactNode | The content to display in the ribbon. | |
position | No | String | The position of the ribbon. |
Basic Usage
The Ribbon
component is used to display a ribbon.
<Card> Ribbon <Ribbon /></Card>
Variants
You can pass a variant
prop to the Ribbon
component to change the color of the ribbon.
<Card>primary <Ribbon variant="primary" /></Card><Card>secondary <Ribbon variant="secondary" /></Card>
Positions
You can pass a position
prop to the Ribbon
component to change the position of the ribbon.
<Card> <Ribbon position="top">top</Ribbon></Card><Card> <Ribbon position="start">start</Ribbon></Card><Card> <Ribbon position="end">end</Ribbon></Card>
Shapes
You can pass a shape
prop to the Ribbon
component to change the shape of the ribbon.
<Card> <span>Ribbon</span> <Ribbon shape="bookmark" /></Card><Card> <span>Ribbon</span> <Ribbon /></Card>
Custom Content
You can pass a content
prop to the Ribbon
component to change the content of the ribbon.
<Card> <Ribbon content={<IconAerialLift />}>Ribbon</Ribbon></Card>