{"_id":"nuxt-anchorscroll","_rev":"6-bdc1345a3b9d713d068368a03b414452","name":"nuxt-anchorscroll","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"nuxt-anchorscroll","version":"1.0.0","license":"MIT","_id":"nuxt-anchorscroll@1.0.0","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"b2e885412a0018dd951f70ad8b59fcab1ea02e69","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.0.tgz","fileCount":13,"integrity":"sha512-QOOLd91idcbEJry9x4/cCIxtuYh8xfMklphsHlnx0sqgiT3bllLUpRFLigmwHeXACVmC1Zypo1QNeo/Iv9TCzw==","signatures":[{"sig":"MEUCIQCEwd9Y3WypbtxXDud7pxhwXqYCdGwwiOHJEarIZ4T98wIgCEN4i/HJ2fkIt7rCDB+SUMAtIUX7jYBPKKbB+i0VSCA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24221},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"3f87691424270341976b8265522b2d331a97328b","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"9.6.7","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"20.3.1","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.5.1","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.5.2","@unocss/nuxt":"^0.53.4","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.0_1688843428046_0.30376455149241477","host":"s3://npm-registry-packages"}},"1.0.1-alpha":{"name":"nuxt-anchorscroll","version":"1.0.1-alpha","license":"MIT","_id":"nuxt-anchorscroll@1.0.1-alpha","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"283662bb323680b90a55c6e3c68ee34dfb4cc535","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.1-alpha.tgz","fileCount":13,"integrity":"sha512-rKmBy/dMOyQP5c/3AbhHAklVBjE7gkH3awYLDyqhZl64LbjH82jygZYfWm1C+V0csWwvbUabt0WQROTKZWKtcw==","signatures":[{"sig":"MEQCIHzVWAIF7B/i/3NocKzYfg+d9yV3qCin7hiYw6EeixhtAiARsMgMyhlHZFx1tjnGvQhd6iYfodPFamqlVrDe2NMMEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24421},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"4f909f1b8615794ccbc47b875da87255b7bca9ec","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"9.6.7","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"20.3.1","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.5.1","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","vue-router":"^4.2.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.5.2","@unocss/nuxt":"^0.53.4","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.1-alpha_1688845522693_0.05764788596532","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"nuxt-anchorscroll","version":"1.0.1","license":"MIT","_id":"nuxt-anchorscroll@1.0.1","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"2659342a014c7587cee7d612f138c6dcdc3658a4","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.1.tgz","fileCount":13,"integrity":"sha512-khWWDbpbIZtrqtzlXSUcTYVKVLMonCY/gfHPH+K5IlmoCYUrak2BIP7quGDwFydcDdKseLhm2ZSaMjOL9PzPbQ==","signatures":[{"sig":"MEQCIFrLyNgwyc5YsDcK5amT9HxFhZq3+P7Ml2XWbDpiRR7cAiBY3Ny88zKwU3WiDcJcff6WBUwD116EqUlSTt6lxfSbiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24474},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"e78d59cc899ce0a45a3611e6ed3f8969934500d5","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"9.6.7","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"20.3.1","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.5.1","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","vue-router":"^4.2.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.5.2","@unocss/nuxt":"^0.53.4","@iconify/json":"^2.2.88","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@iconify-json/carbon":"^1.1.18","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.1_1688847914358_0.3344051449748735","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"nuxt-anchorscroll","version":"1.0.2","license":"MIT","_id":"nuxt-anchorscroll@1.0.2","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"f3e098e3c37b40e92e96be5a0b60fef19cae6d89","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.2.tgz","fileCount":13,"integrity":"sha512-Mn68+wg/CNKYEQWaE1lgvB0updvnlSxz95+xCc3jvS3Qcfnerr1I6nMhElnt6I+ZJKSEXXkXElc62sX4+lL5qA==","signatures":[{"sig":"MEUCIQCj0I9rOVqeGf+8x2t8eNNIzjcRsgsDQ4rJKCKDFpt1dwIgbsYldB+j1p1u9i8vmOREZAWWvst8JMDkZPTnjHZZNxg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24459},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"1561af3d714a8c059d2dd9a192b4a242dbcc2219","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"9.6.7","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"20.3.1","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.5.1","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","vue-router":"^4.2.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.5.2","@unocss/nuxt":"^0.53.4","@iconify/json":"^2.2.88","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@iconify-json/carbon":"^1.1.18","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.2_1688858895707_0.8037515345918747","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"nuxt-anchorscroll","version":"1.0.3","keywords":["anchor","nuxt","nuxt-module","scroll","vue"],"license":"MIT","_id":"nuxt-anchorscroll@1.0.3","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"c29b06542e82ecf60c616b0cf80650e4ba202453","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.3.tgz","fileCount":13,"integrity":"sha512-f/1XzEvaolgsh+V0CgutcJozlBE5iLkp+oF7z/ZJCYMXQrTrPmpe8HnM8WlxTLHjAdFw09jx7dQ5oGQwHZt5tw==","signatures":[{"sig":"MEQCIBnkBBhjSp0Y71CXiZCpxvXA0QX1UFtGKFF0K0Py5MIKAiAaBxkMpkek4d1GE+YpsrzAyqI+CFSuuZvP2+jrJ26u1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26086},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"d61b740e8db7aaa1b9db2dbcf6fefe3d9f462fe4","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"10.1.0","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"20.7.0","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.5.1","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","vue-router":"^4.2.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.5.2","@unocss/nuxt":"^0.53.4","@iconify/json":"^2.2.88","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@iconify-json/carbon":"^1.1.18","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.3_1695997459458_0.28704933526382237","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"nuxt-anchorscroll","version":"1.0.4","keywords":["anchor","nuxt","nuxt-module","scroll","vue"],"license":"MIT","_id":"nuxt-anchorscroll@1.0.4","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"dist":{"shasum":"fc58eee24ce14b3205494ad4b741f4857cbab7f0","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.4.tgz","fileCount":15,"integrity":"sha512-iUblZLcYZH9JyzLpiCd0w2TObv+r6iHjwzXBO+gfbXwUVwsS6LV1QiwwPjvlnUvfHrkaKlAVOOIJQ7trViORfQ==","signatures":[{"sig":"MEQCIHNDm2OA1sQMgjCadNS0gklTLjOE4WruCE47QxFkiJxxAiA+Ayt9VC0JvUCcDdlhXq7PMWXGD0eee0GaSOCgg4FFcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26793},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"7b15c10c13eb3ba888c3c6b77a581f6d31b4148b","scripts":{"dev":"nuxi dev playground","lint":"eslint .","prepack":"nuxt-module-build","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground"},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"repository":{"url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git","type":"git"},"_npmVersion":"11.0.0","description":"Scroll with anchor support for Nuxt","directories":{},"_nodeVersion":"23.5.0","dependencies":{"@nuxt/kit":"^3.5.2"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"nuxt":"^3.12.4","sass":"^1.63.6","eslint":"^8.42.0","vitest":"^0.31.4","vue-router":"^4.2.4","@types/node":"^18","changelogen":"^0.5.3","@nuxt/schema":"^3.15.0","@unocss/nuxt":"^0.53.4","@iconify/json":"^2.2.88","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/test-utils":"^3.5.1","@nuxt/eslint-config":"^0.1.1","@antfu/eslint-config":"^0.39.7","@iconify-json/carbon":"^1.1.18","@nuxt/module-builder":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-anchorscroll_1.0.4_1735744453008_0.8988993068196993","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"nuxt-anchorscroll","type":"module","version":"1.0.5","packageManager":"yarn@3.6.1","description":"Scroll with anchor support for Nuxt","license":"MIT","repository":{"type":"git","url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git"},"keywords":["anchor","nuxt","nuxt-module","scroll","vue"],"exports":{".":{"types":"./dist/types.d.ts","require":"./dist/module.cjs","import":"./dist/module.mjs"}},"main":"./dist/module.cjs","types":"./dist/types.d.ts","scripts":{"prepack":"nuxt-module-build build","dev":"nuxi dev playground","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build --stub && nuxi prepare playground","release":"npm run lint && npm run prepack && npm publish && git push --follow-tags","lint":"eslint ."},"dependencies":{"@nuxt/kit":"^3.5.2"},"devDependencies":{"@antfu/eslint-config":"^0.39.7","@iconify-json/carbon":"^1.1.18","@iconify/json":"^2.2.88","@nuxt/content":"^2.7.0","@nuxt/devtools":"latest","@nuxt/eslint-config":"^0.1.1","@nuxt/module-builder":"^0.8.3","@nuxt/schema":"^3.15.0","@nuxt/test-utils":"^3.5.1","@types/node":"^18","@unocss/nuxt":"^0.53.4","changelogen":"^0.5.3","eslint":"^8.42.0","nuxt":"^3.12.4","sass":"^1.63.6","vitest":"^0.31.4","vue-router":"^4.2.4"},"_id":"nuxt-anchorscroll@1.0.5","gitHead":"1eeb19ee371097da836edcba7056eb9d24183c42","bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","_nodeVersion":"23.5.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-/bWnhceVr+Pvf64RY/Qwz0QPhDf4RD7cXY6L28DA0oauXiVzQ1VQuujte5dUAZydbdM9XvpXk/YVJNu1+7+1jw==","shasum":"fc9c28cf2c524324240f5d6085c41a3aff5aa888","tarball":"https://registry.npmjs.org/nuxt-anchorscroll/-/nuxt-anchorscroll-1.0.5.tgz","fileCount":15,"unpackedSize":26904,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH701borWqA/0MRK6fT7KC3GIDmiEY9tjUxFSuWMBpjyAiA73gmc7ZuDu0yQbm/sUMxuTv1IyPiY27LruxDt2s0l1w=="}]},"_npmUser":{"name":"helltraitor","email":"helltraitor@hotmail.com"},"directories":{},"maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nuxt-anchorscroll_1.0.5_1735744479097_0.9678546760795401"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-08T19:10:28.046Z","modified":"2025-01-01T15:14:39.502Z","1.0.0":"2023-07-08T19:10:28.201Z","1.0.1-alpha":"2023-07-08T19:45:22.928Z","1.0.1":"2023-07-08T20:25:14.532Z","1.0.2":"2023-07-08T23:28:15.901Z","1.0.3":"2023-09-29T14:24:19.698Z","1.0.4":"2025-01-01T15:14:13.179Z","1.0.5":"2025-01-01T15:14:39.303Z"},"bugs":{"url":"https://github.com/helltraitor/nuxt-anchorscroll/issues"},"license":"MIT","homepage":"https://github.com/helltraitor/nuxt-anchorscroll#readme","keywords":["anchor","nuxt","nuxt-module","scroll","vue"],"repository":{"type":"git","url":"git+https://github.com/helltraitor/nuxt-anchorscroll.git"},"description":"Scroll with anchor support for Nuxt","maintainers":[{"name":"helltraitor","email":"helltraitor@hotmail.com"}],"readme":"# nuxt-anchorscroll\r\n\r\n[![npm version][npm-version-src]][npm-version-href]\r\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\r\n[![License][license-src]][license-href]\r\n[![Nuxt][nuxt-src]][nuxt-href]\r\n\r\nThis module provides scroll implementation (scroll to top and scroll to anchor element).\r\nOriginally it was intended for anchor scrolling that's why it's called `nuxt-anchorscroll`\r\n\r\n- [Online playground](https://stackblitz.com/github/helltraitor/nuxt-anchorscroll?file=playground%2Fapp.vue)\r\n\r\n## Features\r\n\r\n- Configured out of the box\r\n- Supports both kinds of layouts*\r\n- Extendable\r\n\r\n### Configured out of the box\r\n\r\n1. For top scroll - scroll instantly, until top with zero offset, ignore `x` axis\r\n2. For anchor scroll - scroll smoothly, until top element with zero offset, ignore `x` axis\r\n3. Surfaces - `html` and `body` elements\r\n4. General function - scroll to anchor if element exist (uses `route.hash` as selector),\r\n   otherwise to top - respects page meta `nuxt-anchorscroll` options\r\n\r\n### Supports both kinds of layouts*\r\n\r\nIn common case, you use cropped html or full html. In first case (you can check this now)\r\nscroll to anchor will not work. If it so, you can have a minimal setup.\r\n\r\nBut in case if anchor scroll is handled (by browser), you need additional setup -\r\nfull explanation in module playground.\r\n\r\n### Extendable\r\n\r\nAnchor scroll can be specified for needed route via `matched` field of `NuxtApp.$anchorScroll`\r\nruntime configuration (default configuration setups before `script setup`)\r\n\r\n```ts\r\nnuxtApp.$anchorScroll!.matched.push(({ path, hash }) => {\r\n  // Exit when route is not represent fixed example\r\n  if (!path.startsWith('/standard/fixed'))\r\n    return undefined\r\n\r\n  if (hash) {\r\n    // All anchor element on this route is mangled\r\n    const targetSelector = `#fixed-${hash.slice(1)}`\r\n    const targetElement = document.querySelector(targetSelector)\r\n    if (targetElement) {\r\n      return {\r\n        toAnchor: {\r\n          target: targetElement as HTMLElement,\r\n          scrollOptions: toValue(useNuxtApp().$anchorScroll?.defaults?.toAnchor) ?? {},\r\n        },\r\n      }\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nAlso your matched function can specify different surfaces for scrolling.\r\n\r\n```ts\r\nnuxtApp.$anchorScroll!.matched.push(({ path, hash }) => {\r\n  // Exit when route is not represent fixed example\r\n  if (!path.startsWith('/scrollable'))\r\n    return undefined\r\n\r\n  const surfaces = [...document.querySelectorAll('#exited-scrollable-surface')]\r\n\r\n  return {\r\n    toAnchor: {\r\n      surfaces,\r\n      scrollOptions: {\r\n        /* ... */\r\n      },\r\n    },\r\n    toTop: {\r\n      surfaces,\r\n      scrollOptions: {\r\n        /* ... */\r\n      },\r\n    }\r\n  }\r\n})\r\n```\r\n\r\n## Quick Setup\r\n\r\n1. Add `nuxt-anchorscroll` dependency to your project\r\n\r\nUse your favorite package manager (I prefer yarn)\r\n\r\n```bash\r\nyarn add -D nuxt-anchorscroll\r\n\r\npnpm add -D nuxt-anchorscroll\r\n\r\nnpm install --save-dev nuxt-anchorscroll\r\n```\r\n\r\nOr install it via `nuxi module`\r\n\r\n```bash\r\nnpx nuxi@latest module add nuxt-anchorscroll\r\n```\r\n\r\n2. Add `nuxt-anchorscroll` to the `modules` section of `nuxt.config.ts`\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n  modules: [\r\n    'nuxt-anchorscroll',\r\n  ]\r\n})\r\n```\r\n\r\n3. Additionally, if you are using transitions, probably you also want to scroll on different hook\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n  modules: [\r\n    'nuxt-anchorscroll',\r\n  ],\r\n\r\n  anchorscroll: {\r\n    hooks: [\r\n      // Or any valid hook if needed\r\n      // Default is `page:finish`\r\n      'page:transition:finish',\r\n    ],\r\n  },\r\n})\r\n```\r\n\r\n4. Additionally, if you using standard layout, see playground explanation.\r\n\r\nThat's it! You can now use `nuxt-anchorscroll` in your Nuxt app ✨\r\n\r\n## Composable\r\n\r\nMost probably that you want to scroll to anchor ro to top on click. That's possible via `useAnchorScroll` composable\r\n\r\n```ts\r\n// Default to top is instant\r\nconst { scrollToAnchor, scrollToTop } = useAnchorScroll({\r\n  toTop: {\r\n    scrollOptions: {\r\n      behavior: 'smooth',\r\n      offsetTop: 0,\r\n    }\r\n  },\r\n})\r\n```\r\n\r\nAnd use it in template\r\n\r\n```html\r\n<template>\r\n  <div\r\n    class=\"box\"\r\n    mt-12\r\n    flex flex-row gap-4 align-baseline\r\n  >\r\n    <h2\r\n      :id=\"id\"\r\n      text-3xl font-extrabold\r\n    >\r\n      <slot />\r\n    </h2>\r\n    <NuxtLink\r\n      :href=\"`#${id}`\"\r\n      mb-a mt-a\r\n      text-xl\r\n      @click=\"scrollToAnchor(id)\"\r\n    >\r\n      #\r\n    </NuxtLink>\r\n  </div>\r\n</template>\r\n```\r\n\r\n<!-- Badges -->\r\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-anchorscroll/latest.svg?style=flat&colorA=18181B&colorB=28CF8D\r\n[npm-version-href]: https://npmjs.com/package/nuxt-anchorscroll\r\n\r\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-anchorscroll.svg?style=flat&colorA=18181B&colorB=28CF8D\r\n[npm-downloads-href]: https://npmjs.com/package/nuxt-anchorscroll\r\n\r\n[license-src]: https://img.shields.io/npm/l/nuxt-anchorscroll.svg?style=flat&colorA=18181B&colorB=28CF8D\r\n[license-href]: https://npmjs.com/package/nuxt-anchorscroll\r\n\r\n[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js\r\n[nuxt-href]: https://nuxt.com\r\n","readmeFilename":"README.md"}