{"id":16183686,"url":"https://github.com/fouita/svelte-tw-slider","last_synced_at":"2025-03-19T02:30:49.833Z","repository":{"id":129139244,"uuid":"295776650","full_name":"fouita/svelte-tw-slider","owner":"fouita","description":"Svelte and tailwindcss slider (range input)","archived":false,"fork":false,"pushed_at":"2021-04-10T08:57:04.000Z","size":18,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T09:26:44.638Z","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T15:50:52.000Z","updated_at":"2024-02-12T13:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e225deb8-8a40-4d04-aeb4-d7ae375f779e","html_url":"https://github.com/fouita/svelte-tw-slider","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.375,"last_synced_commit":"fff6f94d69820207df6129c7e77bc5430e7c57e2"},"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-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouita%2Fsvelte-tw-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fouita","download_url":"https://codeload.github.com/fouita/svelte-tw-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818204,"owners_count":20352629,"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-10-10T07:05:57.314Z","updated_at":"2025-03-19T02:30:49.818Z","avatar_url":"https://github.com/fouita.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte and Tailwind Slider component\n\nForm range (slider) component built with svelte and tailwindcss\n\n# Installation\n```bash\n    $npm i -D @fouita/slider\n```\n\n# Usage\n\n## Single value range\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-simple.jpg)\n\n\u003e image slider-simple\n\n\n```html\n\u003cscript\u003e\n\timport Slider from '@fouita/slider'\t\t\t\t\t\n\tlet value = 21\n\u003c/script\u003e\n\n\u003cdiv class=\"p-6 text-3xl text-center\"\u003e\n\t{value}\t\n\u003c/div\u003e\n\u003cSlider class=\"mt-5 mx-6\" min={0} max={30} bind:value /\u003e\n```\n\n## Multi value range\n\nMulti values works with array of two values, like the following\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-range.jpg)\n\n```html\n\u003cscript\u003e\n\timport Slider from '@fouita/slider'\t\t\t\t\t\n\tlet value = [10,21]\n\u003c/script\u003e\n\n\u003cdiv class=\"p-6 text-3xl text-center\"\u003e\n\t{value}\t\n\u003c/div\u003e\n\u003cSlider class=\"mt-5 mx-6\" min={0} max={30} bind:value /\u003e\n```\n\n## With tooltip\n\nBy adding `tooltip` prop we can show the value when sliding\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-tooltip.jpg)\n\n\n```html\n\u003cSlider tooltip min={0} max={30} bind:value /\u003e\n```\n\nWe can show the tooltip when hovering over the slider pointer by adding `tooltip=hover`\n\n```html\n\u003cSlider tooltip=hover min={0} max={30} bind:value /\u003e\n```\n\n## Custom color\n\nWe can change the color by adding `color` prop\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-pink.jpg)\n\n```html\n\u003cSlider tooltip=hover color=pink-600 min={0} max={30} bind:value /\u003e\n```\n\n## Custom labels\n\nTo change the labels min/max we need to attribute `minLabel` \u0026 `maxLabel`. We can also remove them by using an empty string.\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-mlabel.jpg)\n\n```html\n\u003cSlider tooltip=hover minLabel='$0' maxLabel='Expensive' min={0} max={30} bind:value /\u003e\n```\n\n## Custom indicators \n\nTo change the values on the tooltip we can add a value format by using `valueLabel` prop.\nIn case you need to use only one value (not a range) you can add a simple string `valueLabel=\"$%d\"`\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-vlabel.jpg)\n\n```html\n\u003cSlider valueLabel={['%d €','%d €']} tooltip min={0} max={30} bind:value /\u003e\n```\n\n## Custom scale\n\nWe can use custom array of values and show the desired label when we hit a specific number.\nAssuming a scale of skills `[basic, medium, advanced, expert]`\n\n* 0-5 : basic \n* 5-15 : medium\n* 15-25: advanced\n* 25-30: expert\n\n![slider fouita](https://cdn.fouita.com/assets/pics/template/slider/slider-scale.jpg)\n\n```html\n\u003cscript\u003e\n  import Slider from '@fouita/slider'\n\n  let skill_level=['Basic','Medium','Advanced','Expert']\n  let vlevel=10 // medium by default \n\n\u003c/script\u003e\n\n\u003cSlider bind:value={vlevel} min={0} max={30} minLabel=\"Basic\" maxLabel=\"Expert\" valueLabel={skill_level[Math.round(vlevel/10)]} tooltip=\"hover\" /\u003e\n\n```\n\n\n\n## About\n\n[Fouita : UI framework for svelte + tailwind components](https://fouita.com)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouita%2Fsvelte-tw-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffouita%2Fsvelte-tw-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouita%2Fsvelte-tw-slider/lists"}