Skip to main content

ESM Standalone

This option gives you full control over the CSS. The styles are provided as a separate file, so you can import or load them however you prefer — useful when you want to manage all your stylesheets in one place or customize the CSS directly.

Installation

npm install on-view-animations

Then import both the JS and the CSS from the package:

import { initOVA } from "on-view-animations/dist/ova.esm.js";
import "on-view-animations/dist/ova.css";

Usage

Import both files in your project. The CSS must be loaded separately.

import { initOVA } from "on-view-animations/dist/ova.esm.js";
import "on-view-animations/dist/ova.css";
import { useEffect } from "react";

export default function App() {
useEffect(() => {
initOVA();
}, []);

return (
<div data-ova="animation: fade-top; duration: 800ms">
<h1>Hello World</h1>
</div>
);
}
Direct Download

If you installed via direct download, replace the import paths with './path/to/ova.esm.js' and './path/to/ova.css'.

tip

Use this option if you want to customize or extend the OVA animations by editing ova.css directly, or if you manage all your styles through a single CSS pipeline.