Voit Docs
  • Read Me
  • Introduction
    • Get Started
  • Design Language
    • Philosophy
  • Accessing The Design System
    • Using Variables
  • Structure Overview
  • Accessibility & Inclusivity
  • Guidelines
    • Design tokens
  • Components
    • Overview
    • Accordion
    • Aspect Ratio
    • Badge
    • Breadcrumb
    • Button
    • Tab Button
    • Tile Button
    • Card (Header, Footer)
    • Checkbox
    • ComboBox
    • Digit Entry
    • Dimming Overlay
    • File Drop
    • Index Bar
    • Info Label
    • Inline Message
    • Link
    • List Item
    • List Tree
    • Page Control
    • Pagination
    • Popover
    • Progress Bar
    • Progress Indicator
    • Radio
    • Segmented Control
    • Select
    • Shortcut
    • Slider
    • Stepper
    • Switch
    • Tag
    • Text Area
    • Text field
    • Toast
    • Tooltip
    • Tool Bar
  • Legal
    • Terms & Conditions
    • Contact US
    • License Agreement
    • Feedback
Powered by GitBook
On this page
  • Overview
  • When to use
  • When not to use
  • Anatomy
  • Styles
  • States
  • Size
  • Accessibility
  • Example
  1. Components

Badge

Badges are used to highlight key information, status, or notifications within an interface. They often contain short, concise text or numerical values to draw attention.

PreviousAspect RatioNextBreadcrumb

Last updated 7 months ago

Overview

The Badge component is designed to present immediate, contextual information in a compact format. Typically used for alerts, statuses, or labels.

When to use

  • When users need to quickly identify the state of an element without needing to read detailed descriptions.

  • Apply badges to distinguish items with categories or labels, such as “Featured” or “Sale”.

  • Use badges to indicate the presence of additional actions or options, such as a new feature flag.

When not to use

  • Badges are read-only and not interactive, should not be used instead of tags.

  • Avoid using badges if they clutter the interface or overwhelm the user with too many labels.

  • Badges are not suitable for displaying lengthy text or detailed information.

Anatomy

  1. Tag: A label or keyword that categorizes or describes the badge's purpose. While similar to the Text element, the Tag often serves as a more specific or standardized label.

  2. Icon Leading: An icon placed before the text in the badge. It adds visual context, helping users quickly understand the badge's meaning.

  3. Avatar: Displays a small image or icon representing a user, group, or entity. Useful in situations where identifying the user or source is important, such as in notifications or lists.

  4. Title: A short and direct text, providing the core message. This could be a status like "New" or "Error," a number indicating count, or any other brief descriptor.

  5. Badge Container: foundational element that holds all other components together. It defines the shape, size, and overall layout of the badge.

  6. Icon Trailing: An icon placed after the text or tag. It often complements the leading icon or adds further visual indication of the badge's purpose.

Styles

States

Size

Size
Title (px)
Icon (px)
Container Height (px)

Small

12

16

22

Medium

14

20

28

Large

16

24

32

Accessibility

  • Screen Reader Support: Ensure that all badges are accessible to screen readers by providing descriptive text.

  • Color Contrast: Badges should have sufficient color contrast to be easily readable for all users, including those with color vision deficiencies.

  • Consistent Behavior: Badges should behave consistently across different parts of the interface to avoid confusing the user.

  • Badges are color-coded to represent different types (e.g., red for errors, green for success) but to enhance clarity and context, include elements like profile avatars or icons.

Example

  • Status Updates: Indicate statuses like "Online" or "Error" within an application. For example, a green badge labeled "Active" next to a user’s profile.

  • Notifications: Display badges to show unread messages or new notifications. For instance, a badge with a number "3" on a message icon or a bell icon with a red badge to signify new alerts.

  • Categorization: Apply badges to label or categorize content, such as tagging an item as "New" or "Featured."

  • User Identification: Badges can include profile avatars to identify users within a list. For example, a badge with a user’s photo followed by their name.