EmptyState
Use the EmptyState to communicate that no data is available for a section or view and guide users toward resolving the situation with a clear title, description, and actions.
Import
import { EmptyState } from '@dynatrace/strato-components/content';
Demo
Presets
Use the optional preset prop to show an empty state with or without an illustration, plus a title and details about why the view is empty. Pass the reason for the empty state as a string, or as an object to set further options.
| Reason | Title | Details |
|---|---|---|
something-missing | Data can't be displayed | Complete the required setup to display data. |
no-result | No results found | Try adjusting your timeframe or filters. |
something-wrong | Something went wrong | Try again or contact your admin. |
create-new | There's nothing here yet | Create something to get started. |
no-permission | You'll need some additional permissions to access <app name>. | Contact your admin for more information. |
cancelled | Query cancelled | Try again to fetch data. |
Slots you pass replace the matching default, so you can add actions or adjust the copy. To hide the illustration or change its context, pass an object with context or showVisual, for example preset={{ reason: 'no-result', context: 'table' }}. The context defaults to generic.
No permission
Use the no-permission preset only when the user can't access the app at all. The title names the current app, and the details end with a link to the app in the Playground.
Pass the permissions the user is missing with the missingPermissions option to add a copyable code snippet with the missing permissions, the environment, the app name, and the user's email and ID.
To hide the Playground link, set the showPlaygroundLink option to false.
When a policy hides only part of the data, use the no-result preset instead.
Visual presets
Use VisualPreset within the Visual slot to use predefined illustrations. Different combinations are possible based on the context and type props.
Size
Use the optional size prop, which has a default value, to provide a suitable variation for your use case. When you set size to large, the layout is responsive based on the width of its parent container. Alternatively, set size to auto to adapt the size itself to the width of the parent container.
Small
Default
Large
With size="large", the visual is placed next to the content. When the parent container is narrower than 704 px, the visual is stacked above the content instead.
Auto
With size="auto", the empty state adapts its size to the width of its parent container.
| Parent width | Size |
|---|---|
| Less than 700 px | small |
| 700–999 px | default |
| 1,000 px or more | large |
To limit how large the empty state can get, set the maxSize prop. For example, with maxSize="default", the empty state stays default even when the parent container is 1,000 pixels or wider.
The heading level of the title follows the resulting size, so it changes when the parent container is resized. To keep a fixed heading level, set as on EmptyState.Title.