Components
Read More
Long text that expands on request.
zjkm-ui is a catalog of React components and effects for interfaces that feel alive. Every free component installs as source you own, so you can read and change every line. Pro components add richer effects for AI products, marketing pages and dashboards. Each one respects reduced motion, keeps its decorative layers out of the accessibility tree, and wraps your own markup instead of replacing it.
<ReadMore>
{longText}
</ReadMore>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/read-more.jsonimport { ReadMore } from "@/components/read-more"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
Long text clamped to a few lines with a soft fade, and a Read more button that expands it. The button only appears when the text actually overflows, and it's re-checked when the width changes.
import { ReadMore } from "@/components/read-more";
export function Review({ text }: { text: string }) {
return <ReadMore lines={3}>{text}</ReadMore>;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | The text. | |
lines | number | 3 | Lines shown before Read more. |
className | string | Classes for the wrapper. |
It has no animation, so reduced motion changes nothing.