A centred empty-state panel for "no data", search-miss, or 404 screens. Compose a media slot (icon or illustration), a title, a description, and an optional actions area.
Usage
shad_empty(
title,
description = NULL,
media = NULL,
media_variant = c("default", "icon"),
content = NULL,
class = NULL,
...
)Arguments
- title
The empty-state title.
- description
Optional supporting text (may contain links/tags).
- media
Optional
shad_icon()name or a tag (icon, image, avatar) shown above the title.- media_variant
"icon"(rounded muted tile) or"default"(free-form illustration). Ignored whenmediaisNULL.- content
Optional actions area – buttons, an input, links.
- class
Extra CSS classes.
- ...
Extra attributes on the root.
See also
Other shadshiny tier-1 components:
shad_alert(),
shad_aspect_ratio(),
shad_avatar(),
shad_badge(),
shad_breadcrumb(),
shad_button(),
shad_button_group(),
shad_card(),
shad_code_block(),
shad_item(),
shad_kbd_group(),
shad_label(),
shad_progress(),
shad_scroll_fade(),
shad_separator(),
shad_shimmer(),
shad_skeleton(),
shad_spinner(),
shad_table(),
shad_typography
Examples
shad_empty(
"No projects yet",
description = "Create your first project to get started.",
media = "folder", media_variant = "icon",
content = shad_button("New project")
)
#> <div class="shad-empty">
#> <div class="shad-empty__header">
#> <div class="shad-empty__media shad-empty__media--icon" aria-hidden="true">
#> <svg class="shad-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
#> </div>
#> <div class="shad-empty__title">No projects yet</div>
#> <div class="shad-empty__description">Create your first project to get started.</div>
#> </div>
#> <div class="shad-empty__content">
#> <button type="button" class="shad-btn shad-btn--default">New project</button>
#> </div>
#> </div>