Pill component setup

task brazil Updated Sep 10, 2026 4 min read pill-component-uib-setup.md
Raw file servicenow.com

The Pill component is used to indicate selected values in multi-select fields. It can contain information such as inputs, actions or attributes.

Before you begin

This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see Customize UI Builder pages using components.

Note: This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component.

Role required: admin or ui_builder_admin

Procedure

  1. Define a label for your Pill that differentiates it from other components in the content tree.

    A label makes finding the component easier in a large list of components. For instructions on using the content tree, see Manage UI pages and page variants.

    [Omitted image "pill-content-tree.png"] Alt text: Pill content tree.

  2. Select the Pill component, using one of these methods:

    • Click anywhere within the component.
    • Select the Pill label you created for your component in the content tree. The property fields appear in the Config tab in the setup panel on the right.

Parent Topic:UIB Setup Information

Pill component properties

Configure the appearance and features of the Pill component.

To configure the properties, enter either static or dynamic input. Enter dynamic input by selecting the input type.

Label [property]

Description

Label[label]

Text displayed inside the pill to identify the function of the pill.Default: "Issue 42"

Size[size]

Sets the size of the pill. Choices are: extra small, small, or medium.Default: medium.

Interaction[interaction]

Sets whether the pill can be selected. Choices are: none or select.Default: select.

Icon[icon]

Optional icon that is displayed at the start of the pill.

Selected[selected]

Indicates the selected state. If true, when the page is first opened, the user sees the toggle as selected or "on."

Manage selected [manageSelected]

If set to true, overrides automatic updates to the Selected property. Use the Pill selected set event to intercept the requested change and handle it manually.Default: false.

Tooltip label for dismiss button [tooltipContent]

Optional text to display in a tooltip describing the pill's dismiss button.

Dismissible[canDismiss]

Displays a button at the end of the pill, which is used to dispatch an action. For example, an (X) button can be provided so the user can select the button to remove the pill.

Disabled [disabled]

If set to true, the pill color is muted and select interactions are disabled.Default: false.

Avatar properties [avatarProps]

Displays username, image source, or presence for pill avatar. userName is a string, imageSrc is a string, and presence is available, away, busy, or offline. Default: null.

ARIA properties

An object whose keys reference a specific HTML element (button or icon) within the Pill. The value of each key is an object that contains an ARIA property and corresponding value. An ARIA property is set on the specified element. If the pill doesn't have a label, or if the label doesn't describe the pill's function, you can configure the icon with an aria-label property that provides alt text to describe what the pill does.

Available ARIA properties for button and icon are:

  • aria-braillelabel
  • aria-brailleroledescription
  • aria-colindextext
  • aria-description
  • aria-label
  • aria-placeholder
  • aria-roledescription
  • aria-rowindextext
  • aria-valuetext
## Pill component events

Select event handlers to configure the actions (events) provided with the Pill component.

The Events tab shows the events used by the Pill component. To view the available events, select + Add event mapping. Select the event in the list to add one or more event handlers.

Event handlers

Event handlers work with data resources to link the Pill actions to the data you want to display to your users. Select the event in the list to add one or more event handlers.

For instructions on adding event handlers to an event, see Configure an event handler.

Event descriptions

Event Description
Pill selected set Dispatched when the user toggles the selected status of the Pill. Set the manage-selected property to override the default behavior and handle this action manually.
Pill dismissed Dispatched when the user selects the pill dismiss button. The Pill component doesn't handle this action; its parent must handle it and remove the pill from its state so it's no longer rendered.
Search documentation
Search document titles and file paths on the brazil branch