Skip to content

Commit

Permalink
docs: update types and storydocs
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter authored and github-actions[bot] committed Mar 4, 2024
1 parent a3592df commit 4f2051c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Basic": "import { Toast, createToaster } from '@ark-ui/react'\n\nconst Basic = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast.title}</Toast.Title>\n <Toast.Description>{toast.description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button onClick={() => toast.create({ title: 'Title', description: 'Description' })}>\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n",
"Basic": "import { Toast, createToaster } from '@ark-ui/react'\nimport { useEffect } from 'react'\n\nconst Basic = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast.title}</Toast.Title>\n <Toast.Description>{toast.description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n useEffect(\n () => toast.subscribe((toasts) => toasts.forEach((toast) => console.log('Toast:', toast))),\n [toast],\n )\n\n const handleToast = () => {\n const id = toast.create({ title: 'Title', description: 'Description' })\n console.log('Toast ID:', id)\n }\n\n return (\n <>\n <button onClick={handleToast}>Toast</button>\n <Toaster />\n </>\n )\n}\n",
"Customized": "import { Toast, createToaster } from '@ark-ui/react'\n\nconst Customized = () => {\n const [Toaster, toast] = createToaster({\n placement: 'bottom-start',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast.title}</Toast.Title>\n <Toast.Description>{toast.description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button\n onClick={() =>\n toast.create({\n title: 'Success',\n description: 'This is a success toast',\n type: 'success',\n duration: 20000,\n removeDelay: 250,\n })\n }\n >\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n",
"CustomRender": "import { Toast, createToaster } from '@ark-ui/react'\n\nconst CustomRender = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n // custom render may go directly into the function below\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast.title}</Toast.Title>\n <Toast.Description>{toast.description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button\n onClick={() =>\n toast.create({\n title: 'Please checkout',\n render: (toast) => (\n <div>\n {toast.title} <a href=\"https://ark-ui.com\">Ark UI</a>\n </div>\n ),\n })\n }\n >\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Basic": "import { Toast, createToaster } from '@ark-ui/solid'\n\nconst Basic = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast().title}</Toast.Title>\n <Toast.Description>{toast().description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button onClick={() => toast().create({ title: 'Title', description: 'Description' })}>\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n",
"Basic": "import { Toast, createToaster } from '@ark-ui/solid'\nimport { createEffect } from 'solid-js'\n\nconst Basic = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast().title}</Toast.Title>\n <Toast.Description>{toast().description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n createEffect(() =>\n toast().subscribe((toasts) => toasts.forEach((toast) => console.log('Toast:', toast))),\n )\n\n const handleToast = () => {\n const id = toast().create({ title: 'Title', description: 'Description' })\n console.log('Toast ID:', id)\n }\n\n return (\n <>\n <button onClick={handleToast}>Toast</button>\n <Toaster />\n </>\n )\n}\n",
"Customized": "import { Toast, createToaster } from '@ark-ui/solid'\n\nconst Customized = () => {\n const [Toaster, toast] = createToaster({\n placement: 'bottom-start',\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast().title}</Toast.Title>\n <Toast.Description>{toast().description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button\n onClick={() =>\n toast().create({\n title: 'Success',\n description: 'This is a success toast',\n type: 'success',\n duration: 20000,\n removeDelay: 250,\n })\n }\n >\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n",
"CustomRender": "import { Toast, createToaster } from '@ark-ui/solid'\n\nconst CustomRender = () => {\n const [Toaster, toast] = createToaster({\n placement: 'top-end',\n // custom render may go directly into the function below\n render(toast) {\n return (\n <Toast.Root>\n <Toast.Title>{toast().title}</Toast.Title>\n <Toast.Description>{toast().description}</Toast.Description>\n <Toast.CloseTrigger>Close</Toast.CloseTrigger>\n </Toast.Root>\n )\n },\n })\n\n return (\n <>\n <button\n onClick={() =>\n toast().create({\n title: 'Please checkout',\n render: (toast) => (\n <div>\n {toast().title} <a href=\"https://ark-ui.com\">Ark UI</a>\n </div>\n ),\n })\n }\n >\n Toast\n </button>\n <Toaster />\n </>\n )\n}\n"
}

0 comments on commit 4f2051c

Please sign in to comment.