1.0.7 • Published 2 years ago

astro-directives v1.0.7

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

astro-directives npm

An astro integration for more client directives.

How to use

Install the package

npm install astro-directives

Update astro.config.mjs

import { defineConfig } from "astro/config";
import directives from "astro-directives";

export default defineConfig({
  // ...
  integrations: [directives()],
  experimental: {
    customClientDirectives: true,
  },
});

Note The experimental.customClientDirectives flag may not be needed in the future.

Use a directive

<Component client:hover />

Directives

AttributeLoad the javascript and hydrate on ...
client:clickelement click event
client:hoverelement mouseover event
client:scrollwindow scroll event