Empty Note

View as Markdown

The one line a panel section shows when it has nothing to list, with one action to fix it.

Deals

No open deals with Northwind.

Open tickets

Nothing open. The last ticket closed on 2 December.

Notes

No notes yet.Write one

When to use

The one line a panel section shows when it has nothing to list, with one action to fix it. Use Empty State instead when the whole view or table is empty, not one section.

Usage

import { EmptyNote } from "./ui/uicontext/components/EmptyNote.ts"
const Message = UiSchema.TaggedEnum({ AddedTask: {} })export const NoTasks = (h: Html.H<typeof Message.Type>) =>	EmptyNote(h, { text: "No tasks due this week.", action: { label: "Add a task", onPress: Message.AddedTask() } })

Examples

Framed

framed draws a dashed outline and centers the note, for a slot waiting to be filled.

No pinned messages. Pin one from its menu to keep it here.

No data for the last 7 days.Show 30 days

API reference

Options

EmptyNote options
NameTypeDescription
textrequiredstringWhat isn't there, as a sentence: "No open tickets for this customer."
actionEmptyNoteAction<Message>The one thing to do about it.
iconView.ContentA small icon before the text.
framedbooleanA dashed outline around it, centered: for a slot that's waiting to be filled.
styleStyle—

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/empty-note

Source