Preact

Agrippa has first-class support for Preact projects

Core functionality should work out of the box - Agrippa automatically detects Preact projects in typical setups, and generates components accordingly.

This feature is looking for active feedback

If you’re using Agrippa in a Preact project, we’d love to hear your thoughts and suggestions. Find us on GitHub or Twitter.

Auto-detection and explicitly setting the framework

Agrippa’s auto-detection determines which framework is used in your environment through your package.json’s dependencies. Particularly, Preact is detected through the preact package.
However, some setups have more than one framework as a dependency or none at all, which can lead Agrippa to a different result than the desired one.

If this is the case for your setup, you can explicitly set Agrippa’s options.framework to preact in agrippa.config.mjs:

// @ts-check
// note the new import
import { defineConfig, Framework } from "agrippa";

export default defineConfig({
  options: {
    framework: Framework.PREACT

    // ...
  },
  // ...
});

Framework.PREACT is equivalent to "preact", but using the built-in Framework enum is clearer and less prone to errors.

Also see our React page for react-related docs