The page navigation is complete. You may now navigate the page content as you wish.
Skip to main content

Application State

An informational element that displays the current state of the application.

The Application State is used to communicate status, errors, and zero/empty states.

Usage

When to use

  • When an application encounters an issue or error during its operation.
  • When emphasis is needed on the creation of a new object within a null state.

When not to use

  • When the absence of content is expected and does not require an explanation to the user.
  • When there is a clear and intuitive way to add or populate content.

Alignment

The Application State supports two alignment options: left (default) and center. The alignment affects text alignment, action placement/alignment in the footer, and media placement; however, it does not change the default page alignment.

By default, the Application State has horizontal auto margins applied to it, always centering it on the page or containing element. This can be overridden with CSS properties.

Left alignment

Left aligned application state

Center alignment

Center aligned application state

Media

The media slot is used to add illustrations to increase the visual impact of the Application State.

This provides additional visual prominence while also elevating the brand experience. If the illustration has a circular container, we recommend setting the alignment to center.

Empty state for Vault Secrets, guiding user to create new secrets or importing them

Icon

When set, the icon is displayed side by side with the title.

Showing an icon left of the title, with some body text below it.

This is commonly used when displaying an error state for application failures. The icon must always be accompanied by a title.

Title

The title should be short and provide a clear and concise message.

Error code

If enabled and available, an error code will be shown, providing additional information associated with the title.

Body

Focus on relevant information and avoid unnecessary details. If there is an error, include suggestions or guidance for how the user can resolve the issue, if possible. If no objects are found (zero/empty state), provide a brief explanation on how creating this new object will benefit the user.

The body allows for two types of content: text and generic.

Showing two different kind of body content types, one as text and another as generic yielded content

The Application State supports up to three actions, including Dropdown, Standalone Link, and Button components. Use footer actions to help users resolve errors or access issues with actionable steps.

A button set showing a dropdown, secondary button, and stand alone link

Buttons, along with links, are the most common actions used in the footer. Buttons are more often used in empty state contexts because they provide high visibility for the primary action on the page. Links are more common in error state contexts as a means to provide a solution to the error they encountered.

Read more about when to use Buttons and Links.

Don’t

When there is an empty state that occupies the majority of the page, do not display two similar actions in different areas of the UI. In this example, there is a primary button in the Page Header and in the Application State.

Showing an empty state with a primary button and a page header with a primary button

Do

Instead, use the Application State as the only means of drawing attention to the primary action.

Showing an empty state with a primary button with a page header with out a primary button

Using dropdowns

Dropdowns can be used as actions in the footer in rare cases. Limit dropdowns to one per Application State.

Showing an empty state with a primary button with a page header with out one

Width constraints

The Application State’s content has a max width of 480 pixels. This is done for better readability, ensuring that the max character count is close to 70 characters per line.

Examples

Here are some common use cases for the Application State, however, it is not limited to just these two examples.

Error state

Error states are used when the application encounters an issue or error during its operation. It shows the associated error code, icon, messages, and actions to help users find a solution.

Showing an example of an error state with a 404 error code and two links

Empty state

An empty state occurs when a user has yet to create an object. Illustrations are placed using the media slot to further elevate the experience and express the purpose of the object.

Showing an empty state with a primary and secondary button along with a stand alone link

How to use this component

This component intends to replace a few different simple error and empty/zero state components that exist across product UIs, while providing flexibility to adapt to additional application states. While we’re referring to these as "error state" and "empty state" this is just to help consumers relate to the components that have been replaced. Really, this component can be used to reflect any kind of application state message that is needed.

As an empty state

Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="The item you were looking for was not found." />
</Hds::ApplicationState>

Empty state with header icon

Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" @icon="alert-circle" />
  <A.Body @text="The item you were looking for was not found." />
</Hds::ApplicationState>
Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="The item you were looking for was not found." />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="help" @text="Need Help" @href="/components/alert"
    @iconPosition="trailing" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with yielded body block

Empty state title text
block yield
<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body>
    <Doc::Placeholder @text="block yield" @height="100" @background="#eee" />
  </A.Body>
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with body text

Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with center alignment

Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState @align="center" as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with media

portrait of a cat wearing coat and tie
Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState as |A|>
  <A.Media><img src="/assets/images/avatar-bd9ab58aeb803d6e0c0001377034d99d.png" alt="portrait of a cat wearing coat and tie" /></A.Media>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

As an error state

To indicate that the message is an error state, add @errorCode to the [A].Header component invocation.

The page navigation is complete. You may now navigate the page content as you wish.
Skip to main content

Application State

An informational element that displays the current state of the application.

The Application State is used to communicate status, errors, and zero/empty states.

Usage

When to use

  • When an application encounters an issue or error during its operation.
  • When emphasis is needed on the creation of a new object within a null state.

When not to use

  • When the absence of content is expected and does not require an explanation to the user.
  • When there is a clear and intuitive way to add or populate content.

Alignment

The Application State supports two alignment options: left (default) and center. The alignment affects text alignment, action placement/alignment in the footer, and media placement; however, it does not change the default page alignment.

By default, the Application State has horizontal auto margins applied to it, always centering it on the page or containing element. This can be overridden with CSS properties.

Left alignment

Left aligned application state

Center alignment

Center aligned application state

Media

The media slot is used to add illustrations to increase the visual impact of the Application State.

This provides additional visual prominence while also elevating the brand experience. If the illustration has a circular container, we recommend setting the alignment to center.

Empty state for Vault Secrets, guiding user to create new secrets or importing them

Icon

When set, the icon is displayed side by side with the title.

Showing an icon left of the title, with some body text below it.

This is commonly used when displaying an error state for application failures. The icon must always be accompanied by a title.

Title

The title should be short and provide a clear and concise message.

Error code

If enabled and available, an error code will be shown, providing additional information associated with the title.

Body

Focus on relevant information and avoid unnecessary details. If there is an error, include suggestions or guidance for how the user can resolve the issue, if possible. If no objects are found (zero/empty state), provide a brief explanation on how creating this new object will benefit the user.

The body allows for two types of content: text and generic.

Showing two different kind of body content types, one as text and another as generic yielded content

The Application State supports up to three actions, including Dropdown, Standalone Link, and Button components. Use footer actions to help users resolve errors or access issues with actionable steps.

A button set showing a dropdown, secondary button, and stand alone link

Buttons, along with links, are the most common actions used in the footer. Buttons are more often used in empty state contexts because they provide high visibility for the primary action on the page. Links are more common in error state contexts as a means to provide a solution to the error they encountered.

Read more about when to use Buttons and Links.

Don’t

When there is an empty state that occupies the majority of the page, do not display two similar actions in different areas of the UI. In this example, there is a primary button in the Page Header and in the Application State.

Showing an empty state with a primary button and a page header with a primary button

Do

Instead, use the Application State as the only means of drawing attention to the primary action.

Showing an empty state with a primary button with a page header with out a primary button

Using dropdowns

Dropdowns can be used as actions in the footer in rare cases. Limit dropdowns to one per Application State.

Showing an empty state with a primary button with a page header with out one

Width constraints

The Application State’s content has a max width of 480 pixels. This is done for better readability, ensuring that the max character count is close to 70 characters per line.

Examples

Here are some common use cases for the Application State, however, it is not limited to just these two examples.

Error state

Error states are used when the application encounters an issue or error during its operation. It shows the associated error code, icon, messages, and actions to help users find a solution.

Showing an example of an error state with a 404 error code and two links

Empty state

An empty state occurs when a user has yet to create an object. Illustrations are placed using the media slot to further elevate the experience and express the purpose of the object.

Showing an empty state with a primary and secondary button along with a stand alone link

How to use this component

This component intends to replace a few different simple error and empty/zero state components that exist across product UIs, while providing flexibility to adapt to additional application states. While we’re referring to these as "error state" and "empty state" this is just to help consumers relate to the components that have been replaced. Really, this component can be used to reflect any kind of application state message that is needed.

As an empty state

Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="The item you were looking for was not found." />
</Hds::ApplicationState>

Empty state with header icon

Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" @icon="alert-circle" />
  <A.Body @text="The item you were looking for was not found." />
</Hds::ApplicationState>
Empty state title text

The item you were looking for was not found.

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="The item you were looking for was not found." />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="help" @text="Need Help" @href="/components/alert"
    @iconPosition="trailing" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with yielded body block

Empty state title text
block yield
<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body>
    <Doc::Placeholder @text="block yield" @height="100" @background="#eee" />
  </A.Body>
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with body text

Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with center alignment

Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState @align="center" as |A|>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

Empty state with media

portrait of a cat wearing coat and tie
Empty state title text

Some sentence that conveys a good message to the user

<Hds::ApplicationState as |A|>
  <A.Media><img src="/assets/images/avatar-bd9ab58aeb803d6e0c0001377034d99d.png" alt="portrait of a cat wearing coat and tie" /></A.Media>
  <A.Header @title="Empty state title text" />
  <A.Body @text="Some sentence that conveys a good message to the user" />
  <A.Footer as |F|>
    <F.LinkStandalone @icon="arrow-left" @text="Go back" @href="/" />
  </A.Footer>
</Hds::ApplicationState>

As an error state

To indicate that the message is an error state, add @errorCode to the [A].Header component invocation.