Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Native Select
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
@shadcn/react
@shadcn/helpers
Force UI registry
Utilities
About#
Sonner is built and maintained by emilkowalski.
Installation#
Run the following command:
pnpm dlx shadcn@latest add @force-ui-ember/sonner
Add the Toaster component
import { Toaster } from '@/ember-ui/sonner';
<template>
<main>
{{outlet}}
</main>
<Toaster />
</template>Usage#
import { Toaster } from '@/ember-ui/sonner';<Toaster />To show a toast, inject the toast service and call one of its methods:
import { service } from '@ember/service';
import type ToastService from '@/ember-services/toast';
class MyComponent extends Component {
@service declare toast: ToastService;
showToast = () => {
this.toast.add({
message: 'Event has been created.',
});
};
}Examples#
Types#
Description#
Position#
Use the @position arg to change the position of the toast.
API Reference#
| Arg | Type | Default | Description |
|---|---|---|---|
@position | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-center' | Position of the toaster on the screen. |
@richColors | boolean | false | When true, applies colored backgrounds per toast type. |
@class | string | — | Additional CSS classes for the toaster container. |
Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel