Skip to content

Empty States

An empty state occurs when an element has no content to display. Depending on the context, it tells the user what is missing, why it is missing, and can offer guidance on next steps or alternative actions.

Code

Variants

Create tables and figures Learn about tables and figures
packages/certara-ui/src/components/empty-state/empty-state.tsx
<certara-empty-state
img=""
headline=""
description=""
img-height=""
img-width=""
horizontal
size="md"
>
<span slot="actions">
<certara-button color="brand">
<certara-icon name="plus"></certara-icon>
Create tables and figures
</certara-button>
<a href="https://help.certara.net/en/articles/9299407-viewing-figures" target="_blank" class="btn btn-link">
Learn about tables and figures
<certara-icon name="arrow-up-right-from-square"></certara-icon>
</a>
</span>
</certara-empty-state>

certara-empty-state

Properties

PropertyAttributeDescriptionTypeDefault
descriptiondescriptionOutputs text below headlinestringundefined
headlineheadlineOutputs header as h1 (large) h3(default)stringundefined
horizontalhorizontalToggles horizontal viewbooleanfalse
imgimgPath to image on filesystemstring'welcome'
imgHeightimg-heightHeight of imagenumberundefined
imgWidthimg-widthWidth of imagenumberundefined
sizesizeOutputs the .empty-state__title as an h1"lg" | "md"'md'
widthwidthOptional width of the empty state. Cccepts a value of 30rem, 370px, or any valid CSS size value.stringundefined

Slots

SlotDescription
"actions"Buttons, links, more content
"description-slot"HTML slot for the description. Outputs text below headline.
"headline-slot"HTML slot for the headline. Outputs as h1 (large) h3(default).

We looked high and low, but... "dad" is not here

  • Check your spelling
  • Try different keywords
  • Try using fewer words
<div class="empty-state">
<img alt="" class="empty-state__item empty-state__img" src="/assets/img/empty-states/groups-missing.svg" width="105"/>
<div class="empty-state__message">
<h2 class="empty-state__title--no-results">
<span>
<span class="search-query"></span> is not here
</span>
</h2>
<ul class="empty-state__tips-list">
<li class="empty-state__tips-list-item">…</li>
</ul>
<div class="empty-state__item empty-state__link">
</div>
</div>
</div>
</div>

In Practice

  • Display empty states in the space where the content would otherwise be shown.
  • Can apply to full pages, page sections, cards, dashboards, tables, and side panels.
  • Empty states can include:
  • Image
  • Title
  • Description
  • Buttons
  • Links
  • The size of the image is relative to the size of the container.
  • If the container is very small, limit the empty state to text only.

When to use

Empty states can be caused by a variety of reasons. Some include:

  • No data existing due to first time use of a feature.
  • Access issues dues to permissions or other system configurations.
  • User actions like search or filtering that returns no results, or the successful completion of a workflow.

Content guidelines

Empty states should be helpful and engaging for the user.

Title

  • Clearly explain the reason for the empty state.
  • Use positive or neutral language.

Description

  • Let the user know what action, if any, they can take.
  • Add further explanation for the empty state if necessary.
  • Labels should match the action described in the description.

Accessibility

  • Images used on empty states do not need to be recognized by screen readers and other assistive technologies.
  • For more information, see our accessibility guidelines.

Design resources

Illustrations can be downloaded in our image resources.

View component in Figma