{"id":15285980,"url":"https://github.com/rkrupinski/elm-range-slider","last_synced_at":"2025-07-29T02:34:41.137Z","repository":{"id":62419468,"uuid":"102284642","full_name":"rkrupinski/elm-range-slider","owner":"rkrupinski","description":"A range slider built with Elm.","archived":false,"fork":false,"pushed_at":"2017-09-08T07:53:59.000Z","size":163,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T04:13:51.686Z","etag":null,"topics":["elm-lang","slider"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/rkrupinski/elm-range-slider/latest","language":"Elm","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/rkrupinski.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":"2017-09-03T18:15:13.000Z","updated_at":"2017-09-03T18:21:43.000Z","dependencies_parsed_at":"2022-11-01T16:46:15.303Z","dependency_job_id":null,"html_url":"https://github.com/rkrupinski/elm-range-slider","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rkrupinski/elm-range-slider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkrupinski%2Felm-range-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkrupinski%2Felm-range-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkrupinski%2Felm-range-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkrupinski%2Felm-range-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkrupinski","download_url":"https://codeload.github.com/rkrupinski/elm-range-slider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkrupinski%2Felm-range-slider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267619570,"owners_count":24116582,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["elm-lang","slider"],"created_at":"2024-09-30T15:08:55.223Z","updated_at":"2025-07-29T02:34:41.111Z","avatar_url":"https://github.com/rkrupinski.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [elm-range-slider](http://package.elm-lang.org/packages/rkrupinski/elm-range-slider/latest)\n\nA range slider built with Elm.\n\n![Range slider](assets/slider.gif)\n\n## Usage\n\n### Install\n\n```shell\nelm package install rkrupinski/elm-range-slider\n```\n\n### Import\n\n```elm\nimport Slider.Core as Slider\n```\n\n### Initialize\n\n```elm\nslider : Slider.Model\nslider =\n    Slider.init\n        { size = Just 200\n        , values = Just ( 0.1, 0.9 )\n        , step = Just 0.1\n        }\n```\n\nFor the sake of keeping the API as small as possible, the slider only operates on values within `( 0, 1 )` range. If that's not the case with your code, convert the values manually or check what the `Slider.Helpers` module has got for you:\n\n\n```elm\nimport Slider.Helpers exposing (..)\n```\n\n```elm\nslider : Slider.Model\nslider =\n    Slider.init\n        { size = Just 200\n        , values = Just ( parseValue 0, parseValue 5 )\n        , step = Just \u003c| parseStep 1\n        }\n```\n\n### Update\n\nHandle updating the slider in your update function:\n\n```elm\ncase msg of\n    SliderMsg sliderMsg -\u003e\n        let\n            ( slider, cmd ) =\n                Slider.update sliderMsg model.slider\n        in\n            { model | slider = slider } ! [ Cmd.map SliderMsg cmd ]\n```\n\n### Render\n\nRender the slider using:\n\n```elm\nHtml.map SliderMsg \u003c| Slider.view model.slider\n```\n\n### Subscriptions\n\nThe slider requires subscriptions to work (due to its dependency on the `Mouse` package). Once the slider is initialized, get the required subscriptions using:\n\n```elm\nSub.map SliderMsg \u003c| Slider.subscriptions model.slider\n```\n\n### Read values\n\nRead the current values using:\n\n```elm\nSlider.getValues model.slider\n```\n\nAgain, this function returns a tuple of `Float`s within `( 0, 1 )` range. If that doesn't work for you, convert the values based on your range. And of course, the `Slider.Helpers` module has got you covered:\n\n```elm\nimport Slider.Helpers exposing (..)\n```\n\n```elm\nrenderValues : Slider.Range -\u003e Slider.Values -\u003e Html Msg\nrenderValues range ( left, right ) =\n    let\n        formatValue : Float -\u003e String\n        formatValue =\n            valueFormatter range \u003e\u003e toString\n\n        left_ : String\n        left_ =\n            formatValue left\n\n        right_ : String\n        right_ =\n            formatValue right\n    in\n        text \u003c| left_ ++ \", \" ++ right_\n```\n\n## Styling\n\nThe `Slider.Styles` module contains basic default styles to get you up and running. Use the `Slider.ClassNames` module to generate your custom styles with [elm-css](http://package.elm-lang.org/packages/rtfeldman/elm-css/latest).\n\n\n## Examples\n\nCheck out the [example](example) to see how to make it all work. Additionally, the [example-webpack](example-webpack) directory contains a [webpack](https://webpack.js.org/)-based setup.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkrupinski%2Felm-range-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkrupinski%2Felm-range-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkrupinski%2Felm-range-slider/lists"}