---
title: Pill
label: Pill
order: 210
desc: Display compact statuses and categories with Payload's Pill component.
keywords: ui, component, pill, status, category, tag
---

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:

```tsx
import { Pill } from '@payloadcms/ui'
```

You can also import the component directly:

```tsx
import { Pill } from '@payloadcms/ui/elements/Pill'
```

## Styles

<ComponentPreview component="Pill" example="styles" />

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

## Shape

<ComponentPreview component="Pill" example="shapes" />

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

## Sizes

<ComponentPreview component="Pill" example="sizes" />

## 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.   |
