{"id":18800596,"url":"https://github.com/bitovi/scrolling-nav","last_synced_at":"2026-01-03T22:30:12.788Z","repository":{"id":52766278,"uuid":"351830622","full_name":"bitovi/scrolling-nav","owner":"bitovi","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-05T14:52:19.000Z","size":432,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-01-31T00:22:26.877Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitovi.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":"2021-03-26T15:38:06.000Z","updated_at":"2021-05-05T14:52:22.000Z","dependencies_parsed_at":"2022-08-22T18:40:50.448Z","dependency_job_id":null,"html_url":"https://github.com/bitovi/scrolling-nav","commit_stats":null,"previous_names":["bitovi/sticky-nav"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fscrolling-nav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fscrolling-nav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fscrolling-nav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fscrolling-nav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitovi","download_url":"https://codeload.github.com/bitovi/scrolling-nav/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239734447,"owners_count":19688255,"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-11-07T22:19:15.641Z","updated_at":"2026-01-03T22:30:12.692Z","avatar_url":"https://github.com/bitovi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrolling-nav\n\nA web component for navigating to sections of your page that can stick as you scroll.\n\n## Setup\n\nIf you are using a module loader, you can install the web component with NPM like:\n\n```shell\nnpm install @bitovi/scrolling-nav\n```\n\nImport the web component:\n\n```js\nimport \"../../node_modules/@bitovi/scrolling-nav\";\n```\n\n## Use\n\n\nTo use, just insert the HTML element tag created by the package.\n\n```html\n\u003cscrolling-nav\u003e\u003c/scrolling-nav\u003e\n```\n\nThat's it.\n\n## Changing Default Configuration\n\nYou can optionally provide attributes to the component to customize your experience. Here are the _default_ attribute values.\n\n```html\n\u003cscrolling-nav \n    scrollable-container-selector=\"window\"\n    heading-selector=\"h2\"\n\u003e\u003c/scrolling-nav\u003e\n```\n\n### Attributes\n\n### _scrollable-container-selector_\n\n- required: `false`\n- type: `string`\n- default: `\"window\"`\n\n\nThe `scrollable-container-selector` attribute is the tag (HTML element, class, or ID) contains the section headings that you want to scroll to. By default, it will be the window.\n\n```html\n\u003cscrolling-nav scrollable-container-selector=\".header\"\u003e\u003c/scrolling-nav\u003e\n```\n\n### _heading-selector_\n\n- required: `false`\n- type: `string`\n- default: `\"h2\"`\n\nThe `heading-selector` attribute is the tag (HTML element, class, or ID) that will be used to create the navbar items. By default, it will scour the `\u003cbody\u003e` for H2 tags.\n\n```html\n\u003cscrolling-nav heading-selector=\"h3\"\u003e\u003cscrolling-nav\u003e\n```\n\n## Custom Styles\n\nYou can override or modify the default styles by using the provided IDs and classes. The component is structured like the following:\n\n```html\n    \u003cscrolling-nav\u003e\n        \u003cul class=\"scrolling-nav-inner\"\u003e\n            ...\n            \u003cul class=\"scrolling-nav-item\"\u003e\n                \u003ca\u003eHeading Example 1\u003c/a\u003e\n            \u003c/ul\u003e\n            ...\n            \u003cul class=\"scrolling-nav-item\"\u003e\n                \u003ca\u003eHeading Example 2\u003c/a\u003e\n            \u003c/ul\u003e\n            ...\n        \u003c/div\u003e\n    \u003c/scrolling-nav\u003e\n```\n\n### Navbar Wrapper\n\nTo customize the styles of the navbar container, use the following tag in your styles:\n\n```css\n    scrolling-nav {}\n```\n\n### Navbar Inner Container\n\nTo customize the styles of the navbar inner container (which is scrolled by the outer container), use the following ID in your styles:\n\n```css\n    scrolling-nav \u003e ul {}\n```\n\n### Navbar Items\n\nTo customize the styles of the navbar's items, use the following class in your styles:\n\n```css\n    scrolling-nav \u003e ul \u003e li {}\n```\n\nIf you want to customize the `active` state of a nav item, use the following class in your styles:\n\n```css\n    scrolling-nav \u003e ul \u003e li.scrolling-nav-active {}\n```\n\nThe `scrolling-nav-active` class is added whenever the section represented by the nav item is in or below the top 1/3 of the page and above of the next section in the page. The `scrolling-nav-active` class will only be applied to one item at a time.\n\n## Notes\n\n### Using TypeScript + TSX\n\nYou may get the following linting error on the web component: `Property 'scrolling-nav' does not exist on type 'JSX.IntrinsicElements'`. To fix this, add the following snippet to your `declarations.d.ts` file.  \n\n```ts\n// In ~/declarations.d.ts\n\ndeclare namespace JSX {\n    // ...\n  interface IntrinsicElements {\n      // ...\n    \"scrolling-nav\": any;\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Fscrolling-nav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitovi%2Fscrolling-nav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Fscrolling-nav/lists"}