Subheader

Components > Content Layout > Subheader
Use this component to...
Title a subsection of content within a display block

Overview

A subheader can be used to title subsections of content within a display block.

The subheader comes in medium and small sizes. It can also optionally display a horizontal separator line that, in some cases, can help visually tie together different elements that are titled by the separator.

A subheader can be used to title sections of an edit form. Use the smaller size for the subheader component within edit forms. Also, display the optional separator line for subheaders in edit forms, since this helps visually reinforce that the label and input sub-columns are part of one logical edit column.

For some use cases, consider using a subheader as a visually lightweight alternative to a group box, which is used to contain a subsection of content within a display block. The group box has a heavier appearance than the subheader, with its contrasting header and border.

Record detail has its own separate subheader for titling record detail sections, although this is styled identically to the generic subheader.

Example of subheaders: medium, small, and with the separator displayed

Powder icing jelly croissant marzipan bear claw marshmallow pastry biscuit. Topping dessert icing cotton candy. Donut chocolate bar chocolate cake apple pie cupcake. Cookie bear claw cotton candy. Wafer chupa chups caramels sweet roll.

Candy tart tiramisu chupa chups sweet liquorice lemon drops. Jujubes wafer chocolate cake icing croissant jujubes cookie. Apple pie jujubes oat cake. Brownie icing sweet roll. Dessert macaroon cookie jelly.

Toffee caramels pie lemon drops powder marzipan. Souffle biscuit souffle halvah wafer tiramisu cotton candy. Cake sesame snaps cotton candy cookie caramels gummies jelly. Tart apple pie sesame snaps.


Development

Web component development

Component reference

rui-subheader
rui-subheader
Module: rui-layout - Package: @jha/rui-wc

Labels a subsection of content.

Name Type Default Description
text string '' The text displayed for the subheader.
size string 'medium' Specifies the relative size of the subheader. Valid values are ‘medium’ and ‘small’.
displaySeparator boolean false Specifies whether to display a separator line within the subheader.

Implementation

Use rui-subheader to title subsections of content, including sections of edit forms.

Use rui-subheader instead of the native h1-h6 elements.

Don't
Don’t use rui-subheader for titling record detail sections; use the rui-record-detail-subheader component for that use case instead.

Begin by importing the rui-layout module into your application.

Import the module
// import into app.module
import '@jha/rui-wc/components/rui-layout/rui-layout-imports';

Use the rui-subheader element to create a subheader.

Basic subheader
<rui-subheader text="This is a subheader"></rui-subheader>

Set the size attribute to a value of “small” for small subheaders.

Small subheader
<rui-subheader text="This is a small subheader" size="small"></rui-subheader>

Set the displaySeparator attribute to a value of “true” to display the optional separator line.

Subheader with a separator
<rui-subheader text="This subheader has a separator line" [displaySeparator]="true"></rui-subheader>

Angular component development

Component reference

jha-subheader
jha-subheader
Module: JhaLayoutModule - Package: @jha/jharesponsive

Labels a subsection of content.

Name Type Default Description
jhaText string '' The text displayed for the subheader.
jhaSize string 'Medium' Specifies the relative size of the subheader. Valid values are ‘Medium’ and ‘Small’.
jhaDisplaySeparator boolean false Specifies whether to display a separator line within the subheader.

Implementation

Use jha-subheader to title subsections of content, including sections of edit forms.

Use jha-subheader instead of the native h1-h6 elements.

Don't
Don’t use jha-subheader for titling record detail sections; use the jha-record-detail-subheader component for that use case instead.

Begin by importing the JhaLayoutModule module into your application.

Import the module
// import into app.module
import { JhaLayoutModule } from '@jha/jharesponsive/jha-layout';

@NgModule({
    imports: [
        ...
        JhaLayoutModule,
        ...
    ]
})

export class AppModule(){}

Use the jha-subheader element to create a subheader.

Basic subheader
<jha-subheader jhaText="This is a subheader"></jha-subheader>

Set the jhaSize attribute to a value of “small” for small subheaders.

Small subheader
<jha-subheader jhaText="This is a small subheader" jhaSize="Small"></jha-subheader>

Bind the jhaDisplaySeparator attribute to a value of “true” to display the optional separator line.

Subheader with a separator
<jha-subheader jhaText="This is a small subheader" [jhaDisplaySeparator]="true"></jha-subheader>

Component playground


Design

Figma design

Figma design info
You can find this component in the Components - Content Layout page in the Figma UI Kit.
Dev Component Design Component Name
Subheader

RUI / Layout / Subheader

Available values for the Size property:

  • Medium
  • Small

Switch on the Separator property to display the separator line

A subheader can be used to title subsections of content within a display block or to title sections of an edit form.

Subheader design sample
Subheader design sample

Titling subsections of content with a subheader

You have two options to choose from with a content subheader:

  • The subheader size, which is either medium or small
  • Whether or not to display a separator line to the right of the subheader text

Titling sections of an edit form with a subheader

We always use the small subheader size and display the separator line for subheaders that title sections of an edit form. The separator line helps tie the field label and field value sub columns together into one logical edit column.


Adobe XD design

Adobe XD design info
You can find this component in these artboards in the Adobe XD design samples:
  • Sample App - Subheader
Dev Component Design Component Name
Medium subheader with a separator line JHA / Subheader with “Medium with Separator” state applied
Small subheader with a separator line JHA / Subheader with “Small with Separator” state applied
Medium subheader with a separator line Text element with “JHA / Text / Subheader / Medium” character style applied
Small subheader with a separator line Text element with “JHA / Text / Subheader / Small” character style applied

A subheader can be used to title subsections of content within a display block or to title sections of an edit form.

Subheader design sample
Subheader design sample

Titling subsections of content with a subheader

You have two options to choose from with a content subheader:

  • The subheader size, which is either medium or small
  • Whether or not to display a separator line to the right of the subheader text

Here’s how to set up each of these options:

  • Medium subheader with a separator line:
    • Add a JHA / Subheader component to the artboard.
    • Set the “Medium with Separator” state on the subheader component.
    • Change the subheader text to an appropriate value.
    • The text part of the component uses right alignment, so you’ll typically need to resize the separator line width within the component and the width of the subheader component.
  • Small subheader with a separator line:
    • Add a JHA / Subheader component to the artboard.
    • Set the “Small with Separator” state on the subheader component.
    • Change the subheader text to an appropriate value.
    • The text part of the component uses right alignment, so you’ll typically need to resize the separator line width within the component and the width of the subheader component.
  • Medium subheader without a separator line:
    • Add a text element to the artboard and apply the “JHA / Text / Subheader / Medium” character style.
    • Set the text to an appropriate value.
  • Small subheader without a separator line:
    • Add a text element to the artboard and apply the “JHA / Text / Subheader / Small” character style.
    • Set the text to an appropriate value.

Titling sections of an edit form with a subheader

We always use the small subheader size and display the separator line for subheaders that title sections of an edit form. The separator line helps tie the field label and field value sub columns together into one logical edit column.

Add a subheader component to an artboard with an edit form and position it above the section of the edit form that it titles. Set the component’s state to “Small with Separator”. Change the subheader text to an appropriate value.


Support options
Have questions on this topic?
Join the Responsive UI team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.
Last updated Wed Mar 29 2023