Alpha component
PillNext component is subject to major changes and is for experimentation purposes only. Not recommended for use in production software.
PillNext component is subject to major changes and is for experimentation purposes only. Not recommended for use in production software.
PillNext is a refreshed pill component for communicating category or metadata in a compact format. It supports four visual variants, an optional leading icon with tooltip, and an optional removable end icon.
Alpha: This component is in alpha. Props may change before promotion to stable.
import { PillNext } from '@contentful/f36-pill-next';
function PillNextVariantsExample() {return (<Stack flexDirection="row"><PillNext label="Secondary" variant="secondary" /><PillNext label="Primary" variant="primary" /><PillNext label="Warning" variant="warning" /><PillNext label="Negative" variant="negative" /></Stack>);}
function PillNextRemovableExample() {return (<Stack flexDirection="row"><PillNext label="Removable" onRemove={() => {}} /><PillNext label="Disabled remove" onRemove={() => {}} isDisabled /></Stack>);}
function PillNextWarningExample() {return (<Stack flexDirection="row"><PillNextlabel="Restricted"variant="warning"tooltipContent="This tag has restricted visibility"onRemove={() => {}}/><PillNextlabel="Deleted"variant="negative"tooltipContent="This tag was deleted"onRemove={() => {}}/></Stack>);}
Name | Type | Default |
|---|---|---|
| label required | string | |
| className | string CSS class to be appended to the root element | |
| isDisabled | false true | |
| onRemove | () => void | |
| removeButtonLabel | string | "Remove" |
| testId | string A [data-test-id] attribute used for testing purposes | |
| tooltipContent | string Only rendered for variants with a leading icon (warning/negative). | |
| tooltipProps | Omit<CommonProps & WithEnhancedContent & TooltipInternalProps, "content" | "children" | "withTriggerWrapper"> | |
| variant | "secondary" "primary" "warning" "negative" |
| Variant | Use case | | --------- | ---------------------------------------------------- | | secondary | Default. General-purpose category or metadata label. | | primary | Highlighted or active selection. | | warning | Restricted access or limited visibility. | | negative | Deleted or errored state. |
tooltipContent is provided, the leading icon becomes keyboard-focusable so screen reader and keyboard users can access the explanation.