{"id":20934915,"url":"https://github.com/fouita/svelte-tw-dialog","last_synced_at":"2026-05-23T05:04:56.178Z","repository":{"id":57112859,"uuid":"296880522","full_name":"fouita/svelte-tw-dialog","owner":"fouita","description":"Dialog (modal) component built with svelte and tailwindcss","archived":false,"fork":false,"pushed_at":"2020-09-19T13:58:03.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T00:20:07.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fouita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-19T13:56:21.000Z","updated_at":"2021-07-15T14:35:07.000Z","dependencies_parsed_at":"2022-08-21T13:30:44.233Z","dependency_job_id":null,"html_url":"https://github.com/fouita/svelte-tw-dialog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fouita","download_url":"https://codeload.github.com/fouita/svelte-tw-dialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330265,"owners_count":20274037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T22:11:58.511Z","updated_at":"2025-12-28T07:28:10.888Z","avatar_url":"https://github.com/fouita.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte and tailwindcss Dialog component\n\nDialog component built with svelte and tailwindcss, show modal or info messages!\n\n# Installation\n\n```bash\n$npm i -D @fouita/dialog\n```\n\n# Usage\n\nTo show the dialog component we just need to set true to the `visible` prop\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-simple.jpg)\n\n```html\n\u003cscript\u003e\n import Dialog from '@fouita/dialog'\n\u003c/script\u003e\n\n\u003cDialog visible title=\"Simple Title\" body=\"Simple message!\" /\u003e\n```\n\n\n## Show and hide + Filter\n\nIf we want to show the Dialog when clicking on a button, we better bind the value with `bind:visible={value}` prop.\n\nWe can use also `filter={false}` to show the dialog without background \n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-filter.jpg)\n\n```html\n\u003cscript\u003e\n import Dialog from '@fouita/dialog'\n let visible = false\n function toggle(){\n     visible = !visible\n }\n\u003c/script\u003e\n\n\u003cbutton class=\"px-4 py-2 m-2 border\" on:click={toggle}\u003eToggle\u003c/button\u003e\n\u003cDialog bind:visible title=\"Simple Title\" body=\"Simple message!\" /\u003e\n```\n\n\n## Change round and color\n\nTo change the rounding style we can use tailwindcss rounding suffixes `none, sm, md, lg` and to change the color we can from tailwindcss color names\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-rounded.jpg)\n\n```html\n\u003cDialog rounded=sm color=pink visible title=\"Simple Title\" body=\"Simple message!\" /\u003e\n```\n\nYou can also invert colors by adding `inverted` prop\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-inverted.jpg)\n\n```html\n\u003cDialog rounded=sm inverted color=pink visible title=\"Simple Title\" body=\"Simple message!\" /\u003e\n```\n\n\n## Add custom elements\n\nTo add custom elements in the title, we can use `icon` prop, and to update the body with html we can just write inside the Dialog tag\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-custom.jpg)\n\n```html\n\u003cscript\u003e\n import Dialog from '@fouita/dialog'\n import {LockIcon} from 'svelte-feather-icons'\n\u003c/script\u003e\n\n\u003cDialog visible title=\"With Icon\" icon={LockIcon}\u003e\n    \u003cdiv class=\"p-4 text-center w-64 h-64 text-2xl\"\u003e\n        Cusom Body\n    \u003c/div\u003e\n\u003c/Dialog\u003e\n```\n\n## Dialog position \u0026 align\n\n`position` prop indicates the starting point when showing a dialog, there is 3 positions `top, middle, bottom`\n\n`align` prop handles the horizontal position of the component `left, center, right`\n\nby default we use `middle` and `center` to have the dialog in the center of the page\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-bottom-left.jpg)\n\n```html\n\u003cDialog visible title=\"Simple Title\" inverted position=bottom align=left rounded=none \u003e\n    \u003cdiv class=\"p-4 text-center w-64 h-64 text-2xl\"\u003e\n        Cusom Body\n    \u003c/div\u003e\n\u003c/Dialog\u003e\n```\n\nThe follwing is an example of dialog that popsup from the bottom center of the page\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-success-msg.jpg)\n\n\n```html\n\u003cscript\u003e\n\timport Chip from '@fouita/chip'\n    import Dialog from '@fouita/dialog'\t\t\t\n    import {CheckCircleIcon} from 'svelte-feather-icons'\n\n    let visible = true\n\u003c/script\u003e\n\n\u003cDialog bind:visible position=bottom align=center filter={false} rounded=\"md\" \u003e\n    \u003cChip size=\"xl\" rounded=\"none\" color=\"teal\" class=\"mx-0 my-0\" onDelete={() =\u003e dialog4=false} \u003e\n        \u003cdiv slot=\"avatar\"\u003e\n            \u003cCheckCircleIcon class='w-5 h-5 mx-2' /\u003e\n        \u003c/div\u003e\n        \u003cdiv class=\"py-2\"\u003e\n            This is a success messsage\n            \u003cdiv class=\"text-sm font-base\"\u003e\n                More information about the message can be found \u003cu\u003ehere\u003c/u\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/Chip\u003e\n\u003c/Dialog\u003e\n```\n\nHere is another example to show a list of icons in a dialog box\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-icons.jpg)\n\n```html\n\u003cscript\u003e\n    import Dialog from '@fouita/dialog'\n    import {LinkedinIcon,FacebookIcon,TwitterIcon,SlackIcon} from 'svelte-feather-icons'\n\u003c/script\u003e\n\u003cDialog visible filter={false} align=right color=purple \u003e\n    \u003cdiv class=\"p-4 text-center w-12 h-48 text-purple-600 text-2xl flex flex-col items-center\"\u003e\n        \u003cLinkedinIcon class=\"w-6 h-6 m-2 cursor-pointer hover:text-purple-800\" /\u003e\n        \u003cFacebookIcon class=\"w-6 h-6 m-2 cursor-pointer hover:text-purple-800\" /\u003e\n        \u003cTwitterIcon class=\"w-6 h-6 m-2 cursor-pointer hover:text-purple-800\" /\u003e\n        \u003cSlackIcon class=\"w-6 h-6 m-2 cursor-pointer hover:text-purple-800\" /\u003e\n    \u003c/div\u003e\n\u003c/Dialog\u003e\n```\n\n\n## Custom width and height\n\nWith position we can also indicate the width and the height of the dialog by using `w` and `h` props\n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-w-full.jpg)\n\n```html\n\u003cDialog position=bottom w=full filter={false} rounded=none \u003e\n ...\n\u003c/Dialog\u003e \n```\n\nor we can show a side bar like the following, we used `closable={false}` to hide the `X` icon and disable default closing \n\n![fouita dialog](https://cdn.fouita.com/assets/pics/template/dialog/dialog-side-menu.jpg)\n\n```html\n\u003cDialog visible h=full title=\"Side Menu\" closable={false} inverted align=left rounded=none \u003e\n    \u003cdiv class=\"p-4 text-center w-64 h-64 text-2xl\"\u003e\n        Cusom Menu\n    \u003c/div\u003e\n\u003c/Dialog\u003e\n```\n\n\n# About\n\n[Fouita : UI framework for svelte + tailwind components](https://fouita.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouita%2Fsvelte-tw-dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffouita%2Fsvelte-tw-dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouita%2Fsvelte-tw-dialog/lists"}