The Pill: Compact and Visually Distinct Content Representation

The Pill component is a versatile UI element used to visually represent discrete units of content or items within a container, such as tags, labels, or categories.

Features

Discover the key features of the Pill component.
Compact Indicator
Pill provides a compact indicator for status, categories, or tags, serving as a succinct visual cue that conveys specific information or attributes. Its small size makes it ideal for displaying concise labels or tags in limited space, ensuring efficient communication of relevant details without overwhelming the interface.
Visual Categorization
Offers visual categorization and organization of content or elements. By using pills to categorize or tag items, users can quickly identify and filter relevant information, facilitating efficient navigation and content discovery. This visual organization enhances user experience by reducing cognitive load and streamlining interaction with the interface.
Customizable Design
Tailor pill styles to match interface seamlessly, allowing you to customize aspects such as colors, shapes, sizes, and typography to align with your brand's visual identity and design language. With customizable options, you can create pills that blend harmoniously with your interface while effectively communicating information and enhancing overall visual appeal.

Anatomy

Base
The primary container for the Pill component.
Placeholder Text
Central descriptive text for the pill.
Icon (Left/Right)
Icons that can be placed to the left or right of the placeholder text based on the variant.
Status Dot/Icon
A small visual indicator, often round, representing status or a specific condition.
Avatar/Icon
A small representation of a user's profile picture or a generic user icon.
Digit Badge/Icon
Numerical representation, often used to show quantity or new items.

Example Use Cases

Tagging Systems
Displaying tags or keywords associated with content items, such as articles, products, or images, allowing users to filter or categorize content based on specific criteria.
Filter Controls
Providing filter options for sorting and refining search results, lists, or grids, enabling users to narrow down content based on predefined attributes or characteristics.
Status Indicators
Communicating the status or state of items, such as "New," "Featured," "Hot," or "Sale," to highlight important updates, promotions, or events within a layout.
Navigation Menus
Serving as navigation items or menu links in navigation bars, sidebars, or breadcrumbs, providing users with quick access to different sections or pages of an application or website.
Form Inputs
Acting as selectable options or choices in form fields, dropdown menus, or multi-select inputs, allowing users to input or select specific values or preferences.
Chip Inputs
Serving as removable chips or tokens in input fields, allowing users to enter or remove multiple items, such as email addresses, contacts, or tags, in a user-friendly manner.

Guidelines for Usage

When incorporating the Pill component into user interfaces, consider the following guidelines for optimal implementation:

Consistent Styling: Maintain consistency in the size, shape, color, typography, and spacing of Pill components throughout the interface to create a cohesive visual language and ensure a unified user experience.

Clear Labeling: Use descriptive and concise labels or text content inside Pill components to clearly communicate the meaning or purpose of each pill and facilitate easy comprehension for users.

Visual Differentiation: Ensure that Pill components are visually distinct from surrounding elements or backgrounds by applying appropriate contrast, borders, shadows, or background colors to enhance visibility and legibility.

Responsive Design: Design Pill components to be responsive and adaptable to various screen sizes and device orientations, ensuring optimal usability and readability on both desktop and mobile platforms.

Accessibility Considerations: Ensure that Pill components meet accessibility standards by providing sufficient color contrast, keyboard navigation support, and assistive technology compatibility for users with disabilities, ensuring equal access to content and functionality.

Interactive Behavior: Implement interactive behavior, such as hover effects, focus states, or click/tap feedback, to enhance the interactivity and usability of Pill components, providing visual cues to users when interacting with them.

Scalability and Flexibility: Design Pill components to be scalable and flexible, allowing them to accommodate varying lengths of text content, multiple lines of text, or dynamic content updates without compromising visual integrity or usability.

Variants

Icons
Features an icon on either the left or right side of the pill, accompanied by the central placeholder text.
Status
Uses a dot or specific icon, placed usually on the left, with the placeholder text describing the status.
Avatar
Combines a user's avatar or a default user icon on the left with the user's name or role as the placeholder text.
Digit
Incorporates a number on the left, representing quantity or new items, with a descriptive placeholder text.
product_pill_01

Sizes

.pill-small
A compact size for the component, ideal for limited space or subtle emphasis, making it less prominent but still functional and visible.
.pill-medium
The standard size for the component, providing a balance between visibility and space, suitable for most typical use cases and standard interfaces.
product_pill_02

State

.pill :enabled
The default state where the component is fully interactive and ready for user actions. It appears normal and invites interaction.
.pill :hover
The state when a user places their cursor over the component, indicating it is ready for interaction and often visually changes to show responsiveness.
.pill :focus
The state showing that the component is currently selected or active, highlighted for user awareness and accessibility purposes, often with a border or shadow.
.pill :*disabled
The state where the component is visible but non-interactive, indicating it is not available for use. It often appears faded or greyed out to signal its inactivity.
product_pill_03

Best Practices vs. Common Pitfalls

Do:
  • Use pills to effectively organize and categorize content, enhancing the overall user experience.

  • Ensure consistency in design and usage across the application to maintain clarity and usability.

  • Provide appropriate accessibility attributes to ensure that pills are usable by all users, including those with disabilities.

Don't:
  • Overuse pills, which can clutter the interface and diminish their effectiveness as visual cues.

  • Sacrifice readability or accessibility for aesthetic purposes; prioritize usability and inclusivity in design decisions.

  • Use pills to convey critical information or actions; they are best suited for supplementary or secondary content presentation.

Feedback and support

Encountered an issue or have a question about the design system? Your feedback is invaluable to us. Don't hesitate to contact us. Feel free to offer suggestions or improvements; it's all part of our commitment to continuous feedback and support.