Inline Notice

View as Markdown

One line under a form or a list that says what just happened, such as Saved or Couldn't save, read aloud when it changes.

When to use

One line under a form or a list that says what just happened, such as Saved or Couldn't save, read aloud when it changes. Use Toast instead when the message isn't tied to one form or list.

Usage

import { InlineNotice } from "./ui/uicontext/components/InlineNotice.ts"
export const Saved = <M>(h: Html.H<M>, savedAt: string | null) =>	InlineNotice(h, { tone: "success", text: savedAt === null ? "" : `Saved at ${savedAt}` })

Examples

Tones

Plain for status, then info, success, warning and danger. danger is announced at once; the rest wait for a pause.

Last synced 2 minutes ago

Imports over 10,000 rows run in the background; we'll email you when it's done.

Imported 1,208 contacts.

14 rows skipped: no email address.See rows

API reference

Options

InlineNotice options
NameTypeDescription
textrequiredstringWhat happened or what's wrong. Empty draws only the live region, so the next text is heard.
tone"neutral" | "info" | "success" | "warning" | "danger"danger is announced at once; the others wait for a pause.
actionView.ContentSomething to do about it, after the text: a Retry button, a link.
size"sm" | "md"—
idstringAn id, for the field whose aria-describedby points here.
styleStyle—

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/inline-notice

Source