@clamly/anchor-vue

Vue 3 component, directive and composable for Clamly Anchor reading anchors: SSR-safe and v-anchor.
223 2
Install
npm install @clamly/anchor-vue
Latest Version:0.1.0
Vue:3
License:MIT
Last Updated:Oct 18, 2026
Links: GitHub  ·  npm
Maintainer: mrlamaker

@clamly/anchor-vue

Vue 3 component, directive and composable for Clamly Anchor reading anchors. Works with Vue 3.3 and later, including server rendering and Nuxt.

npm install @clamly/anchor-vue

Component and directive

<script setup lang="ts">
import { AnchorText, vAnchor } from "@clamly/anchor-vue";

defineProps<{ summary: string }>();
</script>

<template>
  <p><AnchorText :text="summary" cadence="saccade" /></p>

  <article v-anchor="{ cadence: 'saccade' }">
    <slot />
  </article>
</template>

<AnchorText> renders identical markup on the server and in the browser, so hydration never mismatches. v-anchor anchors everything inside its element, follows Vue's updates, and runs only in the browser.

Register globally

import { createApp } from "vue";
import { AnchorPlugin } from "@clamly/anchor-vue";

createApp(App).use(AnchorPlugin).mount("#app");

useAnchor(target, options)

import { ref } from "vue";
import { useAnchor } from "@clamly/anchor-vue";

const article = ref<HTMLElement | null>(null);
const strength = ref(45);
const anchor = useAnchor(article, () => ({ fixationStrength: strength.value }));
// anchor.value?.toggle()

The controller follows option changes and is destroyed with the component.

Styles

Live anchoring adds its stylesheet automatically. For <AnchorText>, import @clamly/anchor/styles.css once.

All options are documented in @clamly/anchor.

License

MIT © Clamly

Related Packages

@borstihd/vue-custom-tooltip

A flexible and accessible Vue 3 tooltip component with directive support

7,178 0
@pdanpdan/vue-keyboard-trap

Vue3 and Vue2 directive for keyboard navigation - roving movement and trapping i...

99,464 45
nuxt-a11y

This module integrates Axe tool for auditing website against common Accessibilit...

462
@lexical/a11y

Framework-agnostic accessibility helpers (ARIA live regions, focus management, r...

12,617,619 23,971
vue-axe

Dynamic accessibility analysis for Vue.js using axe-core

1,471,163 188

Version History

Version Released Vue License
0.1.0 ^3.3.0 MIT
Pre-releases (1)
Version Released License
0.0.0-stage