sonner
shadcn-vue/sonnerFreeComponent
shadcn-vue publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-vue on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-vue.com/r/styles/new-york/sonner.jsonSource
1<script lang="ts" setup>2import type { ToasterProps } from "vue-sonner"3import { reactiveOmit } from "@vueuse/core"4import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from "lucide-vue-next"5import { Toaster as Sonner } from "vue-sonner"67const props = defineProps<ToasterProps>()8const delegatedProps = reactiveOmit(props, "toastOptions")9</script>1011<template>12 <Sonner13 class="toaster group"14 :toast-options="{15 classes: {16 toast: 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',17 description: 'group-[.toast]:text-muted-foreground',18 actionButton:19 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',20 cancelButton:21 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',22 },23 }"24 v-bind="delegatedProps"25 >26 <template #success-icon>27 <CircleCheckIcon class="size-4" />28 </template>29 <template #info-icon>30 <InfoIcon class="size-4" />31 </template>32 <template #warning-icon>33 <TriangleAlertIcon class="size-4" />34 </template>35 <template #error-icon>36 <OctagonXIcon class="size-4" />37 </template>38 <template #loading-icon>39 <div>40 <Loader2Icon class="size-4 animate-spin" />41 </div>42 </template>43 <template #close-icon>44 <XIcon class="size-4" />45 </template>46 </Sonner>47</template>
What it pulls in
npm packages
Files it writes
More from shadcn-vue
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-vue | Components | Free | 2 deps · 5 files | |
| alertalert | shadcn-vue | Components | Free | no deps · 4 files | |
| alert-dialogalert-dialog | shadcn-vue | Components | Free | 2 deps · 10 files | |
| aspect-ratioaspect-ratio | shadcn-vue | Components | Free | 1 dep · 2 files | |
| attachmentattachment | shadcn-vue | Components | Free | 1 dep · 10 files | |
| avataravatar | shadcn-vue | Components | Free | 2 deps · 4 files | |
| badgebadge | shadcn-vue | Components | Free | 2 deps · 2 files | |
| breadcrumbbreadcrumb | shadcn-vue | Components | Free | 1 dep · 8 files |
