Three slices of the word stack above it like an echo, then slide off one after another when pointed at. Strong as large menu links.
How to use
Make two files in your project's components folder: mirror-text.tsx and mirror-text.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
import type { CSSProperties } from "react";
import styles from "./mirror-text.module.css";
const DIRECTION = { up: styles.up, down: styles.down, left: styles.left, right: styles.right } as const;
/**
* Three thin slices of the word sit above it like an echo. Point at it and the slices and the word
* slide off one after another. Size and colour go in `className` or `style` (e.g. { fontSize: 72 }).
*/
export function MirrorText({
text,
className,
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
import type { CSSProperties } from "react";
import styles from "./mirror-text.module.css";
const DIRECTION = { up: styles.up, down: styles.down, left: styles.left, right: styles.right } as const;
/**
* Three thin slices of the word sit above it like an echo. Point at it and the slices and the word
* slide off one after another. Size and colour go in `className` or `style` (e.g. { fontSize: 72 }).
*/
export function MirrorText({
text,
className,
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.