Empty
Empty state for when there is no data to display.
Preview
Controls
Device view renders in an isolated frame so real responsive breakpoints apply. Switch to Full for overflowing popovers.
Installation
php artisan ui:add empty
Registry contract
Install confidence
php artisan ui:add empty
writes only the generated targets below. The CLI validates each file hash before writing and
prompts before replacing local changes unless --force is used.
- Version
- 1.2.0
- License
- open
- Stability
- stable
- Contract
- v2
- Foundation
- ≥ 1.0.0
| Type | Generated target |
|---|---|
| blade | resources/views/components/ui/empty.blade.php |
| blade | resources/views/components/ui/empty/header.blade.php |
| blade | resources/views/components/ui/empty/media.blade.php |
| blade | resources/views/components/ui/empty/title.blade.php |
| blade | resources/views/components/ui/empty/description.blade.php |
| blade | resources/views/components/ui/empty/content.blade.php |
Registry dependencies
None.
Package dependencies
composer: jml/brok:^1.0
Guidance
Empty stateExplain the absence of content and provide a next step.
Use when
- Use to explain a blank state and show the next action. Do not leave an empty screen without orientation or a recovery path.
Avoid when
- Always explain what belongs here and what the user should do next.
- Task length
- micro
- Interaction cost
- low
- Interruptiveness
- none
- Input precision
- none
- Mobile / touch risk
- low
- Accessibility risk
- medium
- Needs background context
- No
- Comparison needed
- No
Preferred alternatives
- Inline status for temporary absence
Anti-patterns
- Showing a blank surface without explanation or action
API
manifest knowledge + registry-derived coverageProps
| Prop | Type / values | Default | Description |
|---|---|---|---|
| variant | string | default', 'size' => 'default | Declared by @props in the registry Blade source. |
| as | string | div | Declared by @props in the registry Blade source. |
Slots
default— Primary Blade slot rendered by the component.x-ui.empty.header— Installed subcomponent from the registry item.x-ui.empty.media— Installed subcomponent from the registry item.x-ui.empty.title— Installed subcomponent from the registry item.x-ui.empty.description— Installed subcomponent from the registry item.x-ui.empty.content— Installed subcomponent from the registry item.
Data slots
empty
empty-content
empty-description
empty-header
empty-media
empty-title
Capabilities
Behavior
- Uses server-rendered Blade and semantic HTML.
- Declares registry capability flags: a11y, responsive, rtl, darkMode, localized.
Usage
<x-ui.empty>
<x-ui.empty.header>
<x-ui.empty.media variant="icon">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" />
</svg>
</x-ui.empty.media>
<x-ui.empty.title>{{ __('No projects yet') }}</x-ui.empty.title>
<x-ui.empty.description>{{ __('Create your first project to get started.') }}</x-ui.empty.description>
</x-ui.empty.header>
<x-ui.empty.content>
<x-ui.button>{{ __('Create project') }}</x-ui.button>
</x-ui.empty.content>
</x-ui.empty>
Accessibility & localization
data-slot
Keyboard focus-visible
Localized labels
- Accessibility target: wcag-2.2-aa-target.
- Uses semantic HTML and a stable
data-slotattribute for styling/scripting hooks. - Focus-visible rings use the
ringtoken so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces above.
- Labels go through
__()and the component uses logical properties (ms-*,text-start,start-*) so it mirrors correctly — flip the preview to RTL to confirm.
Source
The exact, editable file ui:add writes
into your app — copy it or own the whole thing. Previews
render this same code; there are no preview-only components.
Changelog
Current version: v1.2.0. See the site changelog for the full release history.