Subhead

readyNot reviewed for a11y
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.

Description

Use Subhead as the start of a section. The :heading slot will render an <h2> font-sized text.

  • Optionally set the :description slot to render a short description and the :actions slot for a related action.
  • Use a succinct, one-line description for the :description slot. For longer descriptions, omit the description slot and render a paragraph below the Subhead.
  • Use the actions slot to render a related action to the right of the heading. Use Primer::ButtonComponent or Primer::Beta::Link.

Accessibility

The :heading slot defaults to rendering a <div>. Update the tag to a heading element with the appropriate level to improve page navigation for assistive technologies. Learn more about best heading practices (WAI Headings)

Arguments

NameRequiredDescription
spacious
Boolean

Whether to add spacing to the Subhead.

hide_border
Boolean

Whether to hide the border under the heading.

system_arguments

Slots

heading

The heading

NameRequiredDescription
tag
Symbol

One of :div, :h1, :h2, :h3, :h4, :h5, or :h6.

danger
Boolean

Whether to style the heading as dangerous.

system_arguments

actions

Actions

NameRequiredDescription
system_arguments

description

The description

NameRequiredDescription
system_arguments