minflow

Feedback

Toast

toast() is a function call rather than a component you place: one Toaster is mounted at the root and any code anywhere can raise a notice through it. Each one rises into the stack, strikes its status glyph once, and drains a hairline countdown along its base so the time left is visible rather than guessed. It leaves without being asked, which is the whole difference between it and an alert.

npx shadcn@latest add @minflow/toast

Where to use it

  • Confirming an action the reader already knows they took: saved, copied, exported.
  • Background results that need noticing but not acting on.
  • Never for something that needs a decision or a fix; an alert holds still long enough to read twice.

Variations

Neutral confirmation

The common case. A short past-tense sentence about what just happened, with no status colour at all.

Success and failure

Reserve ok for a result worth noticing and err for something that actually failed. If every toast carries a tone, the tone stops carrying meaning.

Several at once

When one action produces several results. They stack in arrival order and the rest reflow under layout animation as each one expires.

Tuned dwell

When the message is longer than a few words, or shorter than the default deserves. The countdown always matches the duration you pass, so the bar never lies about the time left.