suiss/ui · Component
Empty
A placeholder that explains why a view has no content and what people can do next.
Empty is an open-source component from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
Empty is a centered container for empty states. Inside it, EmptyHeader groups an optional EmptyMedia with an EmptyTitle and EmptyDescription, and EmptyContent holds the actions, such as buttons, a search field or a help link. All parts are plain, styled elements with no interactive behavior of their own.
Use it when a list, folder, search or page has nothing to show. Keep the title short and use the description to suggest a next step.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
- Install the following dependencies and add the
cnhelper:
- Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Composition
Use the following composition to build a Empty:
Examples
Outline
Empty has a dashed border style but no border width by default. Add className="border" to show the outline.
Default media
Keep the default variant of EmptyMedia to render media, such as a large icon or an illustration, as is.
With search
Put an InputGroup search field and a support link in EmptyContent for a not-found state.
Accessibility
EmptyTitlerenders adiv, not a heading. If the empty state should appear in the document outline, render a heading element inside it or pass the appropriate role and level.- Give interactive elements in
EmptyContentclear accessible names.
API Reference
Empty
The centered container for the empty state.
Also accepts the props of React.ComponentProps<"div">.
EmptyHeader
Groups the media, title and description.
Also accepts the props of React.ComponentProps<"div">.
EmptyMedia
Holds an icon or image above the title.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "icon" | "default" |
Also accepts the props of React.ComponentProps<"div">.
icon places the icon in a small rounded bg-muted tile; default renders the media without a background. EmptyMedia sets data-variant.
EmptyTitle
The short heading of the empty state.
Also accepts the props of React.ComponentProps<"div">.
EmptyDescription
Supporting text that explains the state or suggests a next step.
Also accepts the props of React.ComponentProps<"p">.
It renders a div element even though it accepts paragraph props. Links placed directly inside it are underlined.
EmptyContent
Holds actions such as buttons, inputs or links.
Also accepts the props of React.ComponentProps<"div">.
Each part sets a data-slot, such as empty-header or empty-content, for styling. EmptyMedia uses empty-icon.
Web preview
Empty is a centered column that fills the available space and holds an EmptyHeader with optional EmptyMedia, an EmptyTitle and an EmptyDescription, followed by EmptyContent for actions. Text is centered and the header and content are limited to a readable width.
Use it for empty lists, search results with no matches and first-run screens.
EmptyMedia has two variants: default shows its child as is, such as an illustration, and icon puts an Icon in a small rounded tile. Put buttons or links in EmptyContent.
Installation
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Muted
A filled panel with only a title and description.
Add a background class such as bg-muted to Empty for a filled panel.

Accessibility
EmptyTitlehas theheadingrole.EmptyMediais hidden from screen readers, so the title and description must carry the message.
API Reference
Empty
Centered container.
Also accepts the props of ViewProps.
EmptyHeader
Column for media, title and description.
Also accepts the props of ViewProps.
EmptyMedia
Decorative icon or illustration.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "icon" | "default" |
Also accepts the props of ViewProps.
EmptyTitle
Heading.
Also accepts the props of React.ComponentProps<typeof Text>.
EmptyDescription
Supporting text.
Also accepts the props of React.ComponentProps<typeof Text>.
EmptyContent
Area for actions.
Also accepts the props of ViewProps.
Empty
Centered container.
| Parameter | Type | Default |
|---|---|---|
content | () -> Content | - |
EmptyHeader
Column for media, title and description.
| Parameter | Type | Default |
|---|---|---|
content | () -> Content | - |
EmptyMediaVariant
Values: .default, .icon.
EmptyMedia
Decorative icon or illustration.
| Parameter | Type | Default |
|---|---|---|
_ variant | EmptyMediaVariant: .default | .icon | .default |
content | () -> Content | - |
EmptyTitle
Heading.
| Parameter | Type | Default |
|---|---|---|
_ title | LocalizedStringKey | - |
verbatim | String | - |
Overloads: init(_:), init(verbatim:).
EmptyDescription
Supporting text.
| Parameter | Type | Default |
|---|---|---|
_ description | LocalizedStringKey | - |
verbatim | String | - |
Overloads: init(_:), init(verbatim:).
EmptyContent
Area for actions.
| Parameter | Type | Default |
|---|---|---|
content | () -> Content | - |
EmptyMediaVariant
Values: Default, Icon.
Empty
Centered container.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
EmptyHeader
Column for media, title and description.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
EmptyMedia
Decorative icon or illustration.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
variant | EmptyMediaVariant: Default | Icon | EmptyMediaVariant.Default |
content | @Composable BoxScope.() -> Unit | - |
EmptyTitle
Heading.
| Parameter | Type | Default |
|---|---|---|
text | String | - |
modifier | Modifier | Modifier |
EmptyDescription
Supporting text.
| Parameter | Type | Default |
|---|---|---|
text | String | - |
modifier | Modifier | Modifier |
EmptyContent
Area for actions.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
