Files
upstream-mirror 1416db152c
All checks were successful
Release / Create Version PR or Publish Stable Release (push) Has been skipped
Release / Publish Prerelease to NPM (push) Has been skipped
Monitor Registries / Monitor registry health (push) Has been skipped
snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
2026-09-15 22:44:43 +05:00

51 lines
1.0 KiB
TypeScript

"use client"
import { toast } from "sonner"
import {
Example,
ExampleWrapper,
} from "@/registry/bases/aria/components/example"
import { Button } from "@/registry/bases/aria/ui/button"
export default function SonnerExample() {
return (
<ExampleWrapper>
<SonnerBasic />
<SonnerWithDescription />
</ExampleWrapper>
)
}
function SonnerBasic() {
return (
<Example title="Basic" className="items-center justify-center">
<Button
onPress={() => toast("Event has been created")}
variant="outline"
className="w-fit"
>
Show Toast
</Button>
</Example>
)
}
function SonnerWithDescription() {
return (
<Example title="With Description" className="items-center justify-center">
<Button
onPress={() =>
toast("Event has been created", {
description: "Monday, January 3rd at 6:00pm",
})
}
variant="outline"
className="w-fit"
>
Show Toast
</Button>
</Example>
)
}