Components

Primer Components are reusable, interactive building blocks for designing consistent user interfaces. They include elements for actions, containment, communication, navigation, selection, and text input, ensuring a cohesive and accessible design across applications. Each component is designed to be flexible and can be seamlessly integrated into various projects to enhance functionality and user experience.

placeholder, blank area with an gray background color

ActionBar

A collection of horizontally aligned IconButtons. The IconButtons can be split into groups by adding a divider. When there is not enough space, IconButtons that don't fit will be added to an overflow menu.

Learn more
placeholder, blank area with an gray background color

ActionList

ActionList is a vertical list of interactive actions or options. It's composed of items presented in a consistent, single-column format, with room for icons, descriptions, side information, and other rich visuals.

Learn more
placeholder, blank area with an gray background color

ActionMenu

ActionMenu is composed of ActionList and Overlay patterns used for quick actions and selections.

Learn more
placeholder, blank area with an gray background color

AnchoredOverlay

AnchoredOverlay opens an Overlay relative to the anchor position.

Learn more
placeholder, blank area with an gray background color

Autocomplete

Autocomplete allows users to quickly filter through a list of options and pick one or more values for a field.

Learn more
placeholder, blank area with an gray background color

Avatar

Avatar is an image that represents a user or organization.

Learn more
placeholder, blank area with an gray background color

AvatarPair

AvatarPair is composed of two Avatars, one larger one and a smaller one, overlaid slightly.

Learn more
placeholder, blank area with an gray background color

AvatarStack

AvatarStack displays two or more Avatars in an inline stack.

Learn more
placeholder, blank area with an gray background color

Banner

Banner is used to highlight important information.

Learn more
placeholder, blank area with an gray background color

Blankslate

Blankslate is used as placeholder to tell users why content is missing.

Learn more
placeholder, blank area with an gray background color

Box

Box is a basic wrapper component for most layout related needs.

Learn more
placeholder, blank area with an gray background color

BranchName

BranchName is a label-type component rendered as an <a> tag by default that displays the name of a branch.

Learn more
placeholder, blank area with an gray background color

Breadcrumbs

Breadcrumbs display the current page or context within the site, allowing them to navigate different levels of the hierarchy.

Learn more
placeholder, blank area with an gray background color

Button

Button is used to initiate actions on a page or form.

Learn more
placeholder, blank area with an gray background color

ButtonGroup

ButtonGroup renders a series of buttons.

Learn more
placeholder, blank area with an gray background color

Checkbox

Checkbox is a form control for single and multiple selections.

Learn more
placeholder, blank area with an gray background color

CheckboxGroup

CheckboxGroup renders a set of Checkboxes.

Learn more

CircleBadge

CircleBadge visually connects logos of third-party services, eg. in the marketplace.

Learn more

CircleOcticon

Use CircleOcticon to render any Octicon with a circle background. CircleOcticons are most commonly used to represent the status of a pull request in the comment timeline.

Learn more
placeholder, blank area with an gray background color

CounterLabel

Adds a count to navigational elements and buttons.

Learn more
placeholder, blank area with an gray background color

DataTable

DataTable is a 2-dimensional data structure where each row is an item, and each column is a data point about the item.

Learn more
placeholder, blank area with an gray background color

Details

Details is a styled component to enhance the native behaviors of the <details> element.

Learn more
placeholder, blank area with an gray background color

Dialog

Dialog is a floating surface used to display transient content such as confirmation actions, selection options, and more.

Learn more
placeholder, blank area with an gray background color

FormControl

FormControl displays a labelled input and, optionally, associated validation text and/or hint text.

Learn more
placeholder, blank area with an gray background color

Heading

Heading defines the hierarchical structure and importance of the content they contain.

Learn more
placeholder, blank area with an gray background color

IconButton

IconButton is used for buttons that show an icon in place of a text label.

Learn more
placeholder, blank area with an gray background color

InlineMessage

InlineMessage is used to inform the user about the result of an action within the content.

Learn more
placeholder, blank area with an gray background color

Label

Use the label component to add contextual metadata to a design.

Learn more
placeholder, blank area with an gray background color

LabelGroup

Use LabelGroup to add commonly used margins and other layout constraints to groups of Labels

Learn more
placeholder, blank area with an gray background color

Link

Links are used to apply styles to hyperlink text.

Learn more
placeholder, blank area with an gray background color

NavList

NavList renders a vertical list of navigation links.

Learn more
placeholder, blank area with an gray background color

Overlay

Overlay components codify design patterns related to floating surfaces such as Dialogs and menus.

Learn more
placeholder, blank area with an gray background color

PageHeader

PageHeader determines the top-level headings of a UI.

Learn more
placeholder, blank area with an gray background color

PageLayout

PageLayout defines the header, main, pane, and footer areas of a page.

Learn more
placeholder, blank area with an gray background color

Pagination

Pagination is a horizontal set of links to navigate paginated content.

Learn more

PointerBox

A customisable bordered box with a caret pointer

Learn more
placeholder, blank area with an gray background color

Popover

Popover is used to bring attention to specific user interface elements.

Learn more
placeholder, blank area with an gray background color

ProgressBar

A ProgressBar is a simple chart that can be used to show how complete something is, or visualize parts that make up a whole.

Learn more
placeholder, blank area with an gray background color

Radio

Radio button is a form control for making a single selection from a short list of options.

Learn more
placeholder, blank area with an gray background color

RadioGroup

RadioGroup is used to render a short list of mutually exclusive options.

Learn more
placeholder, blank area with an gray background color

RelativeTime

RelativeTime displays time in a way that is clear, concise, and accessible.

Learn more
placeholder, blank area with an gray background color

SegmentedControl

SegmentedControl is used to pick one choice from a linear set of closely related choices, and immediately apply that selection.

Learn more
placeholder, blank area with an gray background color

Select

Select is for choosing a single option from a dropdown menu of predefined choices.

Learn more
placeholder, blank area with an gray background color

SelectPanel

The SelectPanel is an anchored dialog that allows users to quickly navigate and select one or multiple items from a list. It includes a text input for filtering, supports item grouping, and offers a footer for additional actions. Changes are applied upon closing the panel.

Learn more
placeholder, blank area with an gray background color

SkeletonLoaders

Replaces content while it's in a loading state.

Learn more
placeholder, blank area with an gray background color

Spinner

A Spinner is an indeterminate loading indicator, ideal for processes with unknown or variable durations.

Learn more
placeholder, blank area with an gray background color

Stack

Stack is a layout component that creates responsive horizontal and vertical flows.

Learn more
placeholder, blank area with an gray background color

StateLabel

StateLabel is used for rendering the status of an issue or pull request.

Learn more
placeholder, blank area with an gray background color

Text

An abstraction for using Primer's typographic styles.

Learn more
placeholder, blank area with an gray background color

Textarea

Textarea is used to set a value that is multiple lines of text.

Learn more
placeholder, blank area with an gray background color

TextInput

TextInput is used to set a value that is a single line of text.

Learn more
placeholder, blank area with an gray background color

TextInputWithTokens

TextInputWithTokens is an input for a value that is a list.

Learn more
placeholder, blank area with an gray background color

Timeline

The Timeline component is used to display items on a vertical Timeline, connected by Timeline elements.

Learn more
placeholder, blank area with an gray background color

ToggleSwitch

ToggleSwitch is used to immediately toggle a setting on or off.

Learn more
placeholder, blank area with an gray background color

Token

Token is a compact representation of an object, and is typically used to show a collection of related metadata.

Learn more
placeholder, blank area with an gray background color

Tooltip

Tooltips add additional context to interactive UI elements and appear on mouse hover or keyboard focus.

Learn more
placeholder, blank area with an gray background color

TreeView

TreeView is a hierarchical list of items that may have a parent-child relationship where children can be toggled into view by expanding or collapsing their parent item.

Learn more
placeholder, blank area with an gray background color

Truncate

Use Truncate to shorten overflowing text with an ellipsis.

Learn more
placeholder, blank area with an gray background color

UnderlineNav

The UnderlineNav is used to display navigation in a horizontal tabbed format.

Learn more
placeholder, blank area with an gray background color

UnderlinePanels

The UnderlinePanels are used to break related content into tabbed panels.

Learn more