An open API service indexing awesome lists of open source software.

https://github.com/quentindutot/astro-directives

An astro integration for more client directives.
https://github.com/quentindutot/astro-directives

Last synced: about 1 month ago
JSON representation

An astro integration for more client directives.

Awesome Lists containing this project

README

        

# astro-directives [![npm](https://img.shields.io/npm/v/astro-directives.svg)](https://www.npmjs.com/package/astro-directives)

An astro integration for more client directives.

## How to use

### Install the package

```
npm install astro-directives
```

### Update astro.config.mjs

```tsx
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

```jsx

```

## Directives

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