Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Feedback

TwEmpty

TwEmpty is a Blazor empty state component for when there is no data yet. Set Icon, Title, Description and actions, with Outlined, Filled and Size variants.

Last updated 9 November 2026

Basic usage

Give TwEmpty a Title and a Description that says why there is nothing here. The icon defaults to Icon.Inbox, and without a Title the localized text "No data" is shown.

No messages yet

When someone sends you a message it will show up here.

RAZOR
<TwEmpty Title="No messages yet" Description="When someone sends you a message it will show up here." />

Actions

Set ActionText and OnAction (or ActionHref) for a primary button, and SecondaryActionText for an outlined one beside it. Put anything else in ActionContent; give it basis-full to put it on a row of its own, as the link here does.

No projects yet

You haven't created any projects yet. Get started by creating your first project.

Learn more
RAZOR
<TwEmpty Icon="Icon.Folder2_Open"
         Title="No projects yet"
         Description="You haven't created any projects yet. Get started by creating your first project."
         ActionText="Create project"
         ActionIcon="Icon.Plus_Lg"
         OnAction="@(() => projectsCreated++)"
         SecondaryActionText="Import project"
         OnSecondaryAction="@(() => projectsCreated++)">
    <ActionContent>
        <div class="basis-full text-center text-sm">
            <TwLink Href="/empty">Learn more</TwLink>
        </div>
    </ActionContent>
</TwEmpty>

Media

The icon sits on a tile by default. Set MediaVariant="EmptyMediaVariant.Plain" for a larger icon with no tile, Color to tint it, or AvatarSrc / AvatarName to show a TwAvatar instead. MediaContent takes any markup, and Icon="null" shows no media at all.

No notifications

You're all caught up.

You're offline

Check your connection and try again.

JD

Jane hasn't posted yet

Follow Jane to see her posts here.

No media

This empty state has no icon.

RAZOR
<div class="grid gap-4 md:grid-cols-2">
    <TwEmpty Icon="Icon.Bell" Color="Color.Primary" Title="No notifications" Description="You're all caught up." Outlined />
    <TwEmpty Icon="Icon.Cloud_Slash" MediaVariant="EmptyMediaVariant.Plain" Title="You're offline" Description="Check your connection and try again." Outlined />
    <TwEmpty AvatarName="Jane Doe" Title="Jane hasn't posted yet" Description="Follow Jane to see her posts here." Outlined />
    <TwEmpty Title="No media" Description="This empty state has no icon." Icon="null" Outlined />
</div>

Outlined and filled

Set Outlined for a dashed border that marks out the empty area, such as a drop zone, or Filled for a subtle background. They can be combined, and both follow the theme's rounding.

Outlined

A dashed border.

Filled

A subtle background.

Both

A dashed border on a subtle background.

RAZOR
<div class="grid gap-4 md:grid-cols-3">
    <TwEmpty Icon="Icon.Upload" Title="Outlined" Description="A dashed border." Outlined />
    <TwEmpty Icon="Icon.Inboxes" Title="Filled" Description="A subtle background." Filled />
    <TwEmpty Icon="Icon.Search" Title="Both" Description="A dashed border on a subtle background." Outlined Filled />
</div>

Sizes

Set Size to Size.Sm, Size.Md (the default) or Size.Lg. It scales the padding, the media and the text.

Small

For tight spaces such as a card or a menu.

Medium

The default size.

Large

For a whole page or section.

RAZOR
<div class="grid gap-4 md:grid-cols-3">
    <TwEmpty Size="Size.Sm" Title="Small" Description="For tight spaces such as a card or a menu." Outlined />
    <TwEmpty Size="Size.Md" Title="Medium" Description="The default size." Outlined />
    <TwEmpty Size="Size.Lg" Title="Large" Description="For a whole page or section." Outlined />
</div>

In a card

A small empty state fits inside a TwCard. Set TitleLevel so its heading sits below the card's own heading in the page outline.

Recent orders

Purchases from the last 30 days.

No orders yet

Orders you place will appear here.

Start shopping

Wishlist

Items you have saved for later.

Nothing saved yet

Save a product and it will show up here.

Browse products
RAZOR
<div class="grid gap-4 md:grid-cols-2">
    <TwCard Title="Recent orders">
        <HeaderContent>
            <p class="text-sm text-gray-600 dark:text-gray-300">Purchases from the last 30 days.</p>
        </HeaderContent>
        <ChildContent>
            <TwEmpty Size="Size.Sm" TitleLevel="4" Icon="Icon.Bag" Color="Color.Primary" Title="No orders yet" Description="Orders you place will appear here." ActionText="Start shopping" ActionHref="/empty" />
        </ChildContent>
    </TwCard>
    <TwCard Title="Wishlist">
        <HeaderContent>
            <p class="text-sm text-gray-600 dark:text-gray-300">Items you have saved for later.</p>
        </HeaderContent>
        <ChildContent>
            <TwEmpty Size="Size.Sm" TitleLevel="4" Icon="Icon.Bookmark_Heart" Color="Color.Danger" Title="Nothing saved yet" Description="Save a product and it will show up here." SecondaryActionText="Browse products" SecondaryActionHref="/empty" Filled />
        </ChildContent>
    </TwCard>
</div>

In a data table

Put a TwEmpty in a TwDataTable's EmptyContent to replace the plain "No data available." message.
Invoice

No invoices yet

Invoices you send will be listed here.

RAZOR
<TwDataTable TItem="string" Items="@invoices">
    <TableHeader>
        <tr>
            <th scope="col" class="px-6 py-3">Invoice</th>
        </tr>
    </TableHeader>
    <TableRow Context="invoice">
        <td class="px-6 py-4">@invoice</td>
    </TableRow>
    <EmptyContent>
        <TwEmpty Size="Size.Sm" TitleLevel="4" Icon="Icon.Receipt" Title="No invoices yet" Description="Invoices you send will be listed here." />
    </EmptyContent>
</TwDataTable>

Search results

Set Live when the empty state replaces results in response to the user, so screen readers announce it. Extra content, such as a hint, goes in ChildContent.

No results

Nothing matches "kiwi fruit".

Try a shorter or different word.
RAZOR
<div class="flex flex-col gap-4">
    <TwTextfield T="string" Label="Search fruit" @bind-Value="query" BindEvent="oninput" />
    @if (matches.Count == 0)
    {
        <TwEmpty Live Size="Size.Sm" Icon="Icon.Search" Title="No results" Description="@($"Nothing matches \"{query}\".")" SecondaryActionText="Clear search" OnSecondaryAction="@(() => query = string.Empty)">
            Try a shorter or different word.
        </TwEmpty>
    }
    else
    {
        <ul class="list-disc ps-5 text-sm">
            @foreach (var item in matches)
            {
                <li>@item</li>
            }
        </ul>
    }
</div>

Accessibility

The icon or avatar is decorative and hidden from screen readers, so the Title and Description carry the message. The title is an h3 by default; set TitleLevel (1 to 6) to fit the page's heading outline. Set Live to make the empty state a role="status" live region when it appears after a search or filter. Some screen readers only announce a live region that was already on the page, so for a reliable announcement also update a persistent status, such as a result count. Giving it an AriaLabel without Live makes it a named region. Layout uses logical properties, so it mirrors in a right to left layout.

Keyboard navigation

An empty state is not a Tab stop itself. Its action buttons and links are, in reading order, and keep their own keyboard behaviour.
Key What it does
Tab or Shift+ plus Tab Moves to the next or previous action.
Enter or Space Presses the focused action button.

Theme configuration

Styling is controlled by TwBlazorTheme.Components (a TwEmptyTheme), configured via the AddTwBlazor() options callback described on the Get Started page. Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Property Type Controls
Base string
Outlined string
Filled string
Small string
Medium string
Large string
Media string
Tile string
TileNeutral string
TileSmall string
TileMedium string
TileLarge string
PlainIcon string
PlainIconSmall string
PlainIconMedium string
PlainIconLarge string
Header string
Title string
TitleSmall string
TitleMedium string
TitleLarge string
Description string
DescriptionSmall string
DescriptionMedium string
DescriptionLarge string
Content string
Actions string

Global Theme Configuration

These reuse shared design tokens configured once on TwBlazorTheme, rather than being unique to this component.
Property Type Controls
TileColors TwBlazorPalette

Full reference: TwEmptyTheme on the API docs.

On this page

  • Basic usage
  • Actions
  • Media
  • Outlined and filled
  • Sizes
  • In a card
  • In a data table
  • Search results
  • Accessibility
  • Keyboard navigation
  • Theme configuration
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload