Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Pill

The Pill component displays compact metadata, a category, or a status. Keep its label short so it remains easy to scan.

Import

Inside a Payload Admin Panel Custom Component:

1
import { Pill } from '@payloadcms/ui'

You can also import the component directly:

1
import { Pill } from '@payloadcms/ui/elements/Pill'

Styles

Loading component example…

Use semantic styles only when the label represents that state. For example, use error for a failed state rather than decoration.

Shape

Loading component example…

Pills use Payload's standard small corner radius by default. Add rounded when the label should use the larger rounded corner treatment.

Sizes

Loading component example…

Accessibility

  • Keep labels concise and ensure their meaning does not depend on color alone.
  • Treat a Pill as presentational metadata. Use a Button or Link when the user needs to perform an action.
  • Provide an accessible label when an icon communicates information that is not present in the visible text.

Common props

These are the props most commonly used with this component. See its exported types in @payloadcms/ui for the complete list.

Prop

Type

Default

Description

children

ReactNode

—

Visible pill content.

pillStyle

'light' | 'light-gray' | 'dark' | 'white' | 'always-white' | 'success' | 'warning' | 'error'

'light'

Sets the visual style.

size

'small' | 'medium'

'medium'

Sets the pill height and spacing.

rounded

boolean

false

Uses a larger rounded corner radius.

icon

ReactNode

—

Displays an icon beside the label.

Was this page helpful?

Next

PillSelector