shadcn_ui-sonner

Installation
SKILL.md

Shadcn UI — Sonner

Instructions

Sonner is an opinionated toast component. Ensure ShadSonner is in the widget tree (e.g. in app builder). Get the controller with ShadSonner.of(context). Call sonner.show(ShadToast(...)) to show a toast; use sonner.hide(id) to dismiss. Each toast can have id, title, description, and optional action (e.g. an Undo button).

Show toast

ShadButton.outline(
  child: const Text('Show Toast'),
  onPressed: () {
    final sonner = ShadSonner.of(context);
    final id = Random().nextInt(1000);
    final now = DateTime.now();
    sonner.show(
      ShadToast(
        id: id,
        title: const Text('Event has been created'),
        description: Text(DateFormat.yMd().add_jms().format(now)),
        action: ShadButton(
          child: const Text('Undo'),
          onPressed: () => sonner.hide(id),
        ),
      ),
    );
  },
)

Use a unique id per toast so you can hide it from the action button or elsewhere.

Related skills

More from serverpod/skills-registry

Installs
6
GitHub Stars
8
First Seen
Apr 13, 2026