Skip to content
View Markdown

ContentUnavailableView ​

A message for a screen with no content to show.

tsx
import { ContentUnavailableView, Button } from '@satinhq/kit'

Example ​

Full example
tsx
import { useState } from 'react'
import { Button, ContentUnavailableView, List, Screen, Section } from '@satinhq/kit'

function Example() {
  const [created, setCreated] = useState(false)

  return (
    <Screen>
      {created ? (
        <List id="notes">
          <Section>First note</Section>
        </List>
      ) : (
        <ContentUnavailableView title="No notes" description="Create your first note.">
          <Button onPress={() => setCreated(true)}>New Note</Button>
        </ContentUnavailableView>
      )}
    </Screen>
  )
}

Explain the empty screen ​

Use title for the message and description for the next step.

Offer an action ​

Put a Button in children if the person can create content or retry a request.

API ​

Scroll horizontally to read every column.

PropTypeDescription
titlestringThe heading.
descriptionReactNodeOptional explanation.
symbolSymbolNameOptional system symbol; defaults to tray.
iconReactNodeOptional custom icon, taking precedence over symbol.
childrenReactNodeOptional actions.

Related: Quick start, List, Screen.

:::

Satin runs on the Lumen rendering engine and is open source under the MIT License.