Skip to content

Empty

Displays an empty state placeholder when there is no content.

No content yet

You haven't created any content. Get started by creating your first item.

Installation

bash
npx @galaxy-stack/nebula-cli add empty
bash
npx @galaxy-stack/nebula-cli add empty
bash
npx @galaxy-stack/nebula-cli add empty
bash
# If you have installed galaxy-design globally
galaxy-design add empty

Usage

tsx
import { Empty } from '@/components/empty'
import { Button } from '@/components/button'

export default function EmptyDemo() {
  return (
    <Empty description="No data available">
      <Button>Create New</Button>
    </Empty>
  )
}
vue
<script setup lang="ts">
import { Empty } from '@/components/empty'
import { Button } from '@/components/button'
</script>

<template>
  <Empty description="No data available">
    <Button>Create New</Button>
  </Empty>
</template>
typescript
import { Component } from '@angular/core'
import { EmptyComponent } from '@/components/empty'
import { ButtonDirective } from '@/components/button'

@Component({
  selector: 'app-empty-demo',
  standalone: true,
  imports: [EmptyComponent, ButtonDirective],
  template: `
    <ui-empty description="No data available">
      <button gButton>Create New</button>
    </ui-empty>
  `
})
export class EmptyDemo {}

API Reference

Props

PropTypeDefaultDescriptionFrameworks
descriptionReactNode-Empty state description contentAll
imageReactNode-Custom icon or image contentAll
imageAltstring'Empty'Accessible label for default illustrationAll
classNamestring''CSS class names for containerAll
childrenReactNode-Optional action content below descriptionAll

Examples

Custom Image

tsx
<Empty
  image={<img src="/empty.svg" alt="No data" className="w-32 h-32" />}
  description="No items found"
/>

With Action Button

tsx
<Empty description="No projects yet">
  <Button onClick={() => navigate('/create')}>
    Create First Project
  </Button>
</Empty>

Accessibility

  • Keyboard Navigation: [TODO]
  • Screen Reader: [TODO]
  • Focus Management: [TODO]
  • WCAG Compliance: WCAG 2.1 Level AA compliant

Author

Bùi Trọng Hiếu (kevinbui)

License

MIT © 2025 Bùi Trọng Hiếu (kevinbui)

Released under the MIT License.