Folio
A scroll container whose page tilts with scroll direction and springs flat when idle.
Preview
Installation
pnpm dlx shadcn@latest add @23rd/folioOr from the public GitHub registry:
pnpm dlx shadcn@latest add radiumcoders/23rd.dev/folioUsage
Use it as the scroll viewport; children are the page.
"use client"
import { Folio } from "@/components/ui/folio"
export function Page() {
return (
<Folio className="h-svh bg-background">
<main className="px-10 py-24 text-foreground">
<h1 className="text-5xl font-medium tracking-tight">
The page leans back
</h1>
<p className="mt-6 max-w-md text-sm leading-relaxed text-foreground/70">
Put the site in children. Folio is the scroller.
</p>
</main>
</Folio>
)
}For window scroll, pass windowScroll and mark the page root with data-folio-page:
"use client"
import { Folio } from "@/components/ui/folio"
export function App() {
return (
<>
<div data-folio-page>{/* page content */}</div>
<Folio windowScroll />
</>
)
}Props
| Prop | Type | Default |
|---|---|---|
children | ReactNode / snippet | none |
blur | number | 4, peak edge blur |
perspective | number | 1000, floor 1000 |
returnMs | number | 520, return time after the bottom |
windowScroll | boolean | false |
contentSelector | string | [data-folio-page] |
label | string | Tilting page |
demoId | string | pairs with playFolioDemo({ target }) |
className | string | React only |
class | string | Svelte only |
