{"id":13765059,"url":"https://github.com/johnbeatty/stimulus-sticky-table-header","last_synced_at":"2025-05-10T20:31:32.811Z","repository":{"id":57370989,"uuid":"136180946","full_name":"johnbeatty/stimulus-sticky-table-header","owner":"johnbeatty","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-12T21:47:06.000Z","size":53,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T21:51:43.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnbeatty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-05T13:23:29.000Z","updated_at":"2025-02-26T06:49:48.000Z","dependencies_parsed_at":"2022-09-09T01:13:27.765Z","dependency_job_id":null,"html_url":"https://github.com/johnbeatty/stimulus-sticky-table-header","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/johnbeatty%2Fstimulus-sticky-table-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbeatty%2Fstimulus-sticky-table-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbeatty%2Fstimulus-sticky-table-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbeatty%2Fstimulus-sticky-table-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnbeatty","download_url":"https://codeload.github.com/johnbeatty/stimulus-sticky-table-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480472,"owners_count":21915246,"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-08-03T16:00:33.415Z","updated_at":"2025-05-10T20:31:27.794Z","avatar_url":"https://github.com/johnbeatty.png","language":"JavaScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"\n# Stimulus Sticky Table Header\n\nThis is a simple [StimulusJS](https://stimulusjs.org) controller that keeps the header of a table at the top of window as you scroll through the page.\n\n## Install\n\nThis assumes that [StimulusJS](https://stimulusjs.org) is already installed.\n\nAdd the `stimulus-sticky-table-header` module:\n\n```bash\n$ yarn add stimulus-sticky-table-header\n```\n\nor\n\n```bash\n$ npm install stimulus-sticky-table-header\n```\n\n## Basic Usage\n\nFirst, register the controller with [StimulusJS](https://stimulusjs.org):\n\n```Javascript\n// application.js\nimport { Application } from 'stimulus';\nimport StickyTableHeader from 'stimulus-sticky-table-header';\n\nconst application = Application.start();\napplication.register(\"sticky-table-header\", StickyTableHeader);\n```\n\nNext you need to add the controller's annotations to your table:\n\n```html\n\u003ctable data-controller=\"sticky-table-header\" \n        data-target=\"sticky-table-header.table\" \n        data-action=\"scroll@window-\u003esticky-table-header#onScroll\"\u003e\n```\n\nThe controller will handle moving the header as your page scrolls.\n\nThe tutorial that this is extracted from can be found here: [https://johnbeatty.co/2018/03/20/stimulus-js-tutorial-listening-to-onscroll-events-for-a-sticky-table-header/](https://johnbeatty.co/2018/03/20/stimulus-js-tutorial-listening-to-onscroll-events-for-a-sticky-table-header/)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at \u003chttps://github.com/johnbeatty/stimulus-sticky-table-header\u003e.  This project is intended to be a safe, welcoming space for  collaboration, and contributors are expected to adhere to the  Contributor Covenant code of conduct.\n\n## License\n\nThis package is available as open source under the terms of the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbeatty%2Fstimulus-sticky-table-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnbeatty%2Fstimulus-sticky-table-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbeatty%2Fstimulus-sticky-table-header/lists"}