{"id":22096716,"url":"https://github.com/rl-king/elm-scroll-to","last_synced_at":"2026-03-05T14:31:18.925Z","repository":{"id":58868850,"uuid":"247549001","full_name":"rl-king/elm-scroll-to","owner":"rl-king","description":"Smoothly scroll to an element with a spring animation.","archived":false,"fork":false,"pushed_at":"2023-04-26T06:52:00.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-25T01:59:42.025Z","etag":null,"topics":["animation","elm","scroll","smooth"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/rl-king/elm-scroll-to/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rl-king.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2020-03-15T20:48:27.000Z","updated_at":"2024-06-12T10:34:43.000Z","dependencies_parsed_at":"2025-05-30T15:11:18.628Z","dependency_job_id":"088acafc-a6b2-4eb8-8a1c-a6dda5aa329d","html_url":"https://github.com/rl-king/elm-scroll-to","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rl-king/elm-scroll-to","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-scroll-to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-scroll-to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-scroll-to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-scroll-to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rl-king","download_url":"https://codeload.github.com/rl-king/elm-scroll-to/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-scroll-to/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30130327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["animation","elm","scroll","smooth"],"created_at":"2024-12-01T04:12:19.375Z","updated_at":"2026-03-05T14:31:18.464Z","avatar_url":"https://github.com/rl-king.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-scroll-to\n\nSmoothly scroll to an element or position with a [spring](https://en.wikipedia.org/wiki/Hooke's_law) animation.\n\n[example live](https://rl-king.github.io/elm-scroll-to-example/) |\n[example code](https://github.com/rl-king/elm-scroll-to/tree/master/example).\n\n## Add to your `Model`\n\n```elm\ntype alias Model =\n    { scrollTo : ScrollTo.State }\n\n\ninit : ( Model, Cmd Msg )\ninit =\n    ( { scrollTo = ScrollTo.init }\n    , Cmd.none\n    )\n\n```\n\n## Wire `Msg`s\n\n```elm\nsubscriptions : Model -\u003e Sub Msg\nsubscriptions model =\n    Sub.map ScrollToMsg \u003c|\n        ScrollTo.subscriptions model.scrollTo\n\n\ntype Msg\n    = ScrollToMsg ScrollTo.Msg\n    | ScrollToId String\n\n\nupdate : Msg -\u003e Model -\u003e ( Model, Cmd Msg )\nupdate msg model =\n    case msg of\n        ScrollToMsg scrollToMsg -\u003e\n            let\n                ( scrollToModel, scrollToCmds ) =\n                    ScrollTo.update\n                        scrollToMsg\n                        model.scrollTo\n            in\n            ( { model | scrollTo = scrollToModel }\n            , Cmd.map ScrollToMsg scrollToCmds\n            )\n\n        ScrollToId id -\u003e\n            ( model\n            , Cmd.map ScrollToMsg \u003c|\n                  ScrollTo.scrollTo id\n            )\n```\n\n## In your view\n```elm\ndiv []\n    [ button\n        [ id \"one\"\n        , onClick (ScrollToId \"two\")\n        , style \"display\" \"block\"\n        ]\n        [ text \"Go 👇\" ]\n    , button\n        [ id \"two\"\n        , onClick (ScrollToId \"one\")\n        , style \"margin\" \"2500px 0\"\n        , style \"display\" \"block\"\n        ]\n        [ text \"Go 👆\" ]\n    ]\n```\n\n## Credits\n\nMade with help of [tad-lispy/springs](https://package.elm-lang.org/packages/tad-lispy/springs/latest/)\nand ideas from [linuss/smooth-scroll](https://package.elm-lang.org/packages/linuss/smooth-scroll/latest/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frl-king%2Felm-scroll-to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frl-king%2Felm-scroll-to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frl-king%2Felm-scroll-to/lists"}