Skip to content
Elements Empty

Empty

An empty state with an icon, a title, a description and actions.

On this page

Examples

Empty state

No projects yet

Create your first project to get started.

Razor
<div class="w-full max-w-lg">
    <KlyEmpty Title="No projects yet" Description="Create your first project to get started."
             Icon='KlyIcons.Named("inbox", "size-full")'>
        <Actions>
            <KlyButton Label="New project" LeadingIcon='KlyIcons.Named("plus", "size-5")' />
            <KlyButton Label="Import" Variant="ButtonVariant.Outline" Color="KlyColor.Neutral" />
        </Actions>
    </KlyEmpty>
</div>

Action items

ActionItems draws KlyActionItem records as small buttons, links included.

No invoices yet

Create your first invoice to see it here.

Razor
<div class="w-full max-w-md">
    <KlyEmpty Title="No invoices yet" Description="Create your first invoice to see it here."
              ActionItems="@(new[] { new KlyActionItem("New invoice") { Href = "#", Variant = ButtonVariant.Solid, Color = KlyColor.Primary }, new KlyActionItem("Import") })">
        <Icon>@KlyIcons.Named("inbox")</Icon>
    </KlyEmpty>
</div>

API

KlyEmpty

Placeholder for an area without content, with an icon, a title, a description and actions.

Parameters

Name Type Default Description
ActionItems IReadOnlyList<KlyActionItem> Buttons or links under the text, from data ( KlyActionItem ). They are shown after Actions .
Class string Classes added to the root element, merged last so they win over the theme.
Description string Text under the title.
HeadingLevel int? Renders the title as a heading of this level (1 to 6) instead of a paragraph.
Size KlySize KlySize.Md Size of the empty, from Xs to Xl . When not set, Size applies, else the default of the component. Values: Xs, Sm, Md, Lg, Xl.
Title string Title of the placeholder, rendered with the level of HeadingLevel .
Ui EmptyUi Per-instance class overrides of the slots of the empty, see EmptyUi . They are merged after the theme and the Class parameter wins on the root slot.
Variant EmptyVariant EmptyVariant.Outline Look of the placeholder: Outline , Soft , Subtle or Naked . Values: Outline, Soft, Subtle, Naked.

Slots

Name Type Description
Actions RenderFragment Buttons or links under the text.
Icon RenderFragment Illustration above the title, 24x24 icons such as KlyIcons.Named("inbox") fit.
ChildContent RenderFragment Extra content between the description and the actions.

Ui slots

Ui takes a EmptyUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyEmpty , after the theme and the app configuration.
Header Classes merged into the header slot of KlyEmpty , after the theme and the app configuration.
Icon Classes merged into the icon slot of KlyEmpty , after the theme and the app configuration.
Title Classes merged into the title slot of KlyEmpty , after the theme and the app configuration.
Description Classes merged into the description slot of KlyEmpty , after the theme and the app configuration.
Actions Classes merged into the actions slot of KlyEmpty , after the theme and the app configuration.