23rd logo23rd

Folio

A scroll container whose page tilts with scroll direction and springs flat when idle.

Preview

Installation

pnpm dlx shadcn@latest add @23rd/folio

Or from the public GitHub registry:

pnpm dlx shadcn@latest add radiumcoders/23rd.dev/folio

Usage

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

PropTypeDefault
childrenReactNode / snippetnone
blurnumber4, peak edge blur
perspectivenumber1000, floor 1000
returnMsnumber520, return time after the bottom
windowScrollbooleanfalse
contentSelectorstring[data-folio-page]
labelstringTilting page
demoIdstringpairs with playFolioDemo({ target })
classNamestringReact only
classstringSvelte only