astro-directives

1.0.7 • Public • Published

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

Attribute Load the javascript and hydrate on ...
client:click element click event
client:hover element mouseover event
client:scroll window scroll event

Package Sidebar

Install

npm i astro-directives

Weekly Downloads

1

Version

1.0.7

License

none

Unpacked Size

3.58 kB

Total Files

6

Last publish

Collaborators

  • quentindutot