Badge
A short label such as new or sale, in the status colours and the commerce roles promo, discount, new and price, at three sizes.
Parts
| Part | File | Does |
|---|---|---|
| Badge | Badge.vue | Marks an item with a short label such as new or sale. |
Styling
All of Badge’s styles live in badge.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- class-variance-authority
- reka-ui
API reference
Marks an item with a short label such as new or sale. Renders a <span>.
Props 5
| Prop | Type | Default | |
|---|---|---|---|
| asChild | boolean | false | |
| |||
| as | AsTag | Component | 'span' | |
| |||
| variant | 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'primary' | 'promo' | 'discount' | 'new' | 'price' | 'neutral' | |
| |||
| size | 'md' | 'sm' | 'lg' | 'md' | |
| |||
| class | ClassValue | — | |
| |||
Data attributes 1
| Data attribute | Values | |
|---|---|---|
| data-variant | 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'primary' | 'promo' | 'discount' | 'new' | 'price' | |
| ||