Spoiler Text - React Component | Kokonut UI
Spoiler Text
Inline text hidden under drifting specks, like a chat spoiler. A click blows the specks away from the point you touched.
Install with
npx shadcn@latest add https://kokonutui.com/r/spoiler-text.json
Installation
Spoiler Text is a free, open-source React component in the Kokonut UI Texts collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/spoiler-text.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/spoiler-text
Usage
import SpoilerText from "@/components/kokonutui/spoiler-text";
export default function Example() {
return <SpoilerText />;
}
Props
className
string
Extra classes for the root element.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
cn from lib/utils.ts |
shadcn init | |
| React | 19 |
Your app |
| Tailwind CSS | 4 |
Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.
On this page
[Cradle Text
A headline hung like a Newton's cradle, so a knock on one letter clacks through the word, built with React and pendulum physics.](/content/docs/texts/cradle-text/index.html) [Marker Text
Hand-drawn highlights, underlines, circles, boxes and strikes that draw themselves in reading order when the text comes into view.](/content/docs/texts/marker-text/index.html)