In-view title
Bring a section title in as it scrolls into view.
npx shadcn@latest add @silicon-ui/in-view-titleInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/in-view-titleManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/in-view-title/in-view-title.tsx
- components/silicon-ui/in-view-title/in-view-title.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
text* | string | — |
variant | InViewTitleVariant
| "blur" |
as | "h1" | "h2" | "h3" | "h2" |
lines | string[] | — |
className | string | — |
id | string | — |
once | boolean | true |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens