![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@leafygreen-ui/chip
Advanced tools
yarn add @leafygreen-ui/chip
npm install @leafygreen-ui/chip
import { Chip } from `@leafygreen-ui/chip`;
<Chip label="leafygreen" />
or
<Chip
label="leafygreen"
variant="blue"
baseFontSize={13}
disabled
onDismiss={() => {}}
chipCharacterLimit={10}
chipTruncationLocation="end"
dismissButtonAriaLabel="aria-label"
darkMode
/>
Prop | Type | Description | Default |
---|---|---|---|
label | React.ReactNode | Label rendered in the chip | |
chipTruncationLocation | 'end' | 'middle' | 'none' | 'start' | Defines where the ellipses will appear in a Chip when the label length exceeds the chipCharacterLimit . If none is passed, the chip will not truncate. Note: If there is any truncation, the full label text will appear inside a tooltip on hover | none |
chipCharacterLimit | number | Defines the character limit of a Chip before they start truncating. Note: the three ellipses dots are included in the character limit and the chip will only truncate if the chip length is greater than the chipCharacterLimit . | |
baseFontSize | '13' | '16' | Determines the base font-size of the chip. | |
variant | 'gray' | 'blue' | 'green' | 'purple' | 'red' | 'yellow' | 'blue' | The color of the chip. | |
glyph | React.ReactElement | An icon glyph rendered before the text. To use a custom icon, see Link docs | |
disabled | boolean | Determines if the chip should be disabled. | false |
onDismiss | React.MouseEventHandler<HTMLButtonElement> | Callback when dismiss button is clicked. If set, a dismiss button will render. | |
dismissButtonAriaLabel | string | aria-label for the dismiss button. | ${label} deselect |
darkMode | boolean | Render the component in dark mode. | false |
... | native span attributes | Any other props will be spread on the root span element |
FAQs
LeafyGreen UI Kit Chip
We found that @leafygreen-ui/chip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.