Chip
Loading example…
Chip is part of the Atoms set, imported from @jcsoftdev/ui/atoms.
Import
Section titled “Import”import { Chip } from "@jcsoftdev/ui/atoms";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/atoms/chip.
<Chip tone="neutral"> Corte clásico</Chip>| Prop | Type | Default | Description |
|---|---|---|---|
tone |
ChipTone |
"neutral" |
|
size |
"sm" | "md" |
"md" |
sm is the compact tag: it grows with its content, tightens the padding and uses tabular numerals, so codes, counts and ids line up. Pair it with square and a neutral tone for a tag. |
square |
boolean |
Use the smaller chip radius instead of a full pill. | |
icon |
ReactNode |
Leading decorative icon; wins over statusIcon. |
|
statusIcon |
boolean |
Prefix info, success, warning and danger chips with their status glyph. |
|
onClick |
MouseEventHandler<HTMLSpanElement> |
A chip with onClick (or role="button") is interactive and never shorter than 30px (--control-height-sm), the smallest hit area of the kit, whatever its size. |
|
onRemove |
(() => void) |
Appends a remove button that calls this. | |
removeLabel |
string |
Accessible name of the remove button. Defaults to the localized “Remove”. | |
intent |
string |
||
intentKey |
string |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/atoms/chip/chip.tsx