Skip to content

Empty

Display placeholder content when there is no data to show.

import { Empty } from 'asterui'

Basic Empty

Simple empty state with default image.

No data
import { Empty } from 'asterui'

function App() {
  return (
      <Empty />
    )
}

export default App

Custom Description

Empty state with custom description text.

No data available
import { Empty } from 'asterui'

function App() {
  return (
      <Empty description="No data available" />
    )
}

export default App

Custom Image

Empty state with custom image or icon.

No files found
import { Empty } from 'asterui'

function App() {
  return (
      <Empty
        image={
          <svg className="w-16 h-16 text-base-content/30" fill="none" viewBox="0 0 24 24" stroke="currentColor">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" />
          </svg>
        }
        description="No files found"
      />
    )
}

export default App

With Action Button

Empty state with action button.

No items in your cart
import { Empty, Button } from 'asterui'

function App() {
  return (
      <Empty description="No items in your cart">
        <Button color="primary">Start Shopping</Button>
      </Empty>
    )
}

export default App

Simple Image

Minimal empty state with smaller image.

No results
import { Empty } from 'asterui'

function App() {
  return (
      <Empty
        image={Empty.PRESENTED_IMAGE_SIMPLE}
        description="No results"
      />
    )
}

export default App
PropertyDescriptionTypeDefault
descriptionText or node to display as descriptionReact.ReactNode'No Data'
imageCustom image or icon; set to null to hideReact.ReactNodeEmpty.PRESENTED_IMAGE_DEFAULT
imageStyleStyling applied to the image containerReact.CSSProperties-
childrenExtra content like buttons or actionsReact.ReactNode-
classNameAdditional CSS classesstring-
data-testidTest ID for the componentstring'empty'