Browse documentation
Reference / Installation
React and Vue
Use the same compiled stylesheet in JSX or Vue single-file components. Keep selectable classes in complete strings so Mono can discover them.
Connect the Vite application
Follow Using Vite to install Mono, set the source patterns, and run the watcher alongside your dev server. Keep your framework’s existing entry script. Add the stylesheet link to index.html or import the generated file once in your app entry.
import './mono.css'Compose a React component
Use className for JSX. Each option in this map contains all the classes for one state. Setting the current prop updates the appearance and exposes the current page to assistive technology.
const styles = {
current: "rounded bg-black px-3 py-2 text-white",
other: "rounded px-3 py-2 hover:underline",
}
export function PageLink({ current, href, children }) {
return (
<a href={href} aria-current={current ? "page" : undefined}
className={current ? styles.current : styles.other}>
{children}
</a>
)
}Compose a Vue component
Bind a literal utility string or an object of complete classes. This native disclosure keeps the question keyboard-accessible and only displays the answer when expanded.
<script setup>
defineProps({ title: String })
</script>
<template>
<details class="rounded-lg border p-4">
<summary class="cursor-pointer font-semibold">{{ title }}</summary>
<div class="mt-3 text-sm leading-relaxed"><slot /></div>
</details>
</template>