mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
16 lines
1.9 KiB
JSON
16 lines
1.9 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "toast-with-status",
|
|
"type": "registry:example",
|
|
"description": "Success toast",
|
|
"registryDependencies": ["@coss/toast"],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/examples/toast-with-status.tsx",
|
|
"content": "\"use client\"\n\nimport { Button } from \"@/registry/default/ui/button\"\nimport { toastManager } from \"@/registry/default/ui/toast\"\n\nexport default function ToastWithStatus() {\n return (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n variant=\"outline\"\n onClick={() => {\n toastManager.add({\n title: \"Success!\",\n description: \"Your changes have been saved.\",\n type: \"success\",\n })\n }}\n >\n Success Toast\n </Button>\n <Button\n variant=\"outline\"\n onClick={() => {\n toastManager.add({\n title: \"Uh oh! Something went wrong.\",\n description: \"There was a problem with your request.\",\n type: \"error\",\n })\n }}\n >\n Error Toast\n </Button>\n <Button\n variant=\"outline\"\n onClick={() => {\n toastManager.add({\n title: \"Heads up!\",\n description: \"You can add components to your app using the cli.\",\n type: \"info\",\n })\n }}\n >\n Info Toast\n </Button>\n <Button\n variant=\"outline\"\n onClick={() => {\n toastManager.add({\n title: \"Warning!\",\n description: \"Your session is about to expire.\",\n type: \"warning\",\n })\n }}\n >\n Warning Toast\n </Button>\n </div>\n )\n}\n",
|
|
"type": "registry:example"
|
|
}
|
|
],
|
|
"categories": ["toast", "button"]
|
|
}
|