{"id":15313875,"url":"https://github.com/itsdouges/react-sticky-header","last_synced_at":"2025-10-08T23:31:52.845Z","repository":{"id":57345400,"uuid":"87806753","full_name":"itsdouges/react-sticky-header","owner":"itsdouges","description":"🍯 A sticky header for React.js","archived":true,"fork":false,"pushed_at":"2018-09-08T06:43:02.000Z","size":7553,"stargazers_count":54,"open_issues_count":7,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T13:26:50.101Z","etag":null,"topics":["gw2armory","header","javascript","react","react-sticky","reactjs","sticky"],"latest_commit_sha":null,"homepage":"","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/itsdouges.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}},"created_at":"2017-04-10T12:12:30.000Z","updated_at":"2024-04-09T05:27:11.000Z","dependencies_parsed_at":"2022-09-13T02:22:48.656Z","dependency_job_id":null,"html_url":"https://github.com/itsdouges/react-sticky-header","commit_stats":null,"previous_names":["madou/react-sticky-header"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-sticky-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-sticky-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-sticky-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-sticky-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsdouges","download_url":"https://codeload.github.com/itsdouges/react-sticky-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235300326,"owners_count":18967734,"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":["gw2armory","header","javascript","react","react-sticky","reactjs","sticky"],"created_at":"2024-10-01T08:43:29.832Z","updated_at":"2025-10-08T23:31:47.091Z","avatar_url":"https://github.com/itsdouges.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [react-sticky-header](https://github.com/madou/react-sticky-header)\n\n[![NPM version](http://img.shields.io/npm/v/react-sticky-header.svg?style=flat-square)](https://www.npmjs.com/package/react-sticky-header)\n[![NPM downloads](http://img.shields.io/npm/dm/react-sticky-header.svg?style=flat-square)](https://www.npmjs.com/package/react-sticky-header)\n[![Build Status](http://img.shields.io/travis/madou/react-sticky-header/master.svg?style=flat-square)](https://travis-ci.org/madou/react-sticky-header)\n[![codecov](https://codecov.io/gh/madou/react-sticky-header/branch/master/graph/badge.svg)](https://codecov.io/gh/madou/react-sticky-header)\n[![Dependency Status](http://img.shields.io/david/madou/react-sticky-header.svg?style=flat-square)](https://david-dm.org/madou/react-sticky-header)\n\nLightweight sticky header made for React that works with both colours and images. You can see an example implementation over at [Guild Wars 2 Armory](https://gw2armory.com).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/madou/react-sticky-header/blob/master/example.gif?raw=true\" style=\"margin:0 auto\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\n```sh\nnpm install react-sticky-header\n```\n\n## Usage\n\n```javascript\n// Import the base CSS, if you're using webpack just import them straight.\n// Else import them into your base CSS.\nimport 'react-sticky-header/styles.css';\nimport StickyHeader from 'react-sticky-header';\n\nconst MyHeader = () =\u003e (\n  \u003cStickyHeader\n    // This is the sticky part of the header.\n    header={\n      \u003cdiv className=\"Header_root\"\u003e\n        \u003ch1 className=\"Header_title\"\u003eReactStickyHeader\u003c/h1\u003e\n\n        \u003cul className=\"Header_links\"\u003e\n          \u003cli className=\"Header_link\"\u003eWhen\u003c/li\u003e\n          \u003cli className=\"Header_link\"\u003eWhy\u003c/li\u003e\n          \u003cli className=\"Header_link\"\u003eAbout\u003c/li\u003e\n        \u003c/ul\u003e\n      \u003c/div\u003e\n    }\n  \u003e\n    \u003csection\u003e\n      \u003cp\u003e\n        This section will be what the sticky header scrolls over before entering into\n        sticky state. See the gif above or run the test story book to see examples.\n      \u003c/p\u003e\n    \u003c/section\u003e\n  \u003c/StickyHeader\u003e\n);\n```\n\n| prop | type | required | description |\n|-|-|-|-|\n| header | Children | yes | A react element that will be the sticky part of the header. |\n| children | Children  | no | Elements that you want to appear under the sticky header. |\n| headerOnly | boolean | no | Use this to force the header into \"sticky\" mode. It will automatically hide the `children` and calculate the height spacer for `header`. |\n| onSticky | (boolean) =\u003e void | no | Callback fired when the header enters/leaves sticky state. See Sticky State section. |\n| backgroundImage | string | no | Self explanatory. |\n| backgroundColor | string | no | Self explanatory. |\n| className | string | no | Self explanatory. |\n| stickyOffset | number | no | The number to offset the sticky header. |\n\n### Sticky State\n\nWhen the component enters sticky state, it will add a class name `is-sticky` to the root element of the header.\n\n## React Story Book\n\nTo run the component in various states, run the following command then go to `http://localhost:6006/`.\n\n```bash\nnpm start\n```\n\n### Testing\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsdouges%2Freact-sticky-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsdouges%2Freact-sticky-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsdouges%2Freact-sticky-header/lists"}