Unroll

v1.0.0
FreeShowcase & Media3DWebGLpowered by @vectorvesper/motion

An image rolled up like a scroll, in grey. Point at it, or tap it, and it unrolls flat as its colour comes in; move away and it rolls back up. Shows the plain image under reduced motion.

Unroll

Installation

Step 1. Initialize ProjectOne-time setup

Run once in your project root to configure paths and dependencies:

npx vectorvesper init
Step 2. Add ComponentInstalls source & assets

Downloads and registers the component in your project:

npx vectorvesper add unroll
Step 3. Required DependenciesAuto-installed with CLI

If installing manually or managing your package lock:

npm install @vectorvesper/motion three
Packages:@vectorvesper/motionthree

Usage

A single feature image that should reward a hover: a case study cover, a product photo, a gallery piece. The image fits inside the area whole, with room left round it for the roll.

Usage

import { Unroll } from "@/components/vv/unroll";

export function Feature() {
  return (
    <Unroll
      src="/boats.jpg"
      alt="Painted rowing boats on turquoise water"
      style={{ height: "80svh" }}
    />
  );
}

Do

  • Write alt text: the component is announced as an image.
  • Pick a colourful image when grayscale is on, so the colour arriving is the payoff.

Don't

  • Do not set rest to 1 and expect a hover effect: it then rests fully open.

WebGL — render it on the client only

On Next.js, load it with ssr: false from a Client Component, as below. Vite apps need nothing extra.

"use client";

import dynamic from "next/dynamic";

const Unroll = dynamic(
  () => import("@/components/vv/unroll").then((m) => m.Unroll),
  { ssr: false }
);
This component respects prefers-reduced-motion and provides a graceful fallback.

Props

An image rolled up like a scroll, in grey. Point at it, or tap it, and it unrolls flat as its colour comes in; move away and it rolls back up.

<Unroll />

The rolled image. Fills the area, which is 100svh tall unless you size it, and fits the image inside it.

PropTypeDefaultDescription
src*string—The image.
alt*string—What the image shows, for screen readers.
turnsnumber2How many times the image wraps round when rolled.
radiusnumber0.17How thick the roll is, as a share of the image's width.
speednumber2How quickly it unrolls and rolls back.
grayscalebooleantrueRolled up, the image is grey, and its colour comes in as it opens.
restnumber0How far open it rests, 0 rolled to 1 flat.
classNamestring—Sizes the area. The image fits inside it, whole. Without a height it is 100svh tall.
styleReact.CSSProperties—Inline styles for the area. A height here wins over the default.
Under reduced motion it shows the plain image, flat and in colour.
Runs on the Vector Vesper runtime: it stops drawing when it is off screen, draws at a lower resolution on a slow device, and comes back by itself if the browser drops its graphics context.
Client component. It renders its still state on the server and starts drawing once it mounts, so it is safe in a server-rendered route.

Source

/**
 * Unroll — Vector Vesper
 * https://vectorvesper.dev/components
 *
 * Copyright (c) 2026 Vector Vesper
 * Released under the MIT License. This notice must be retained in copies and
 * substantial portions of the file. https://vectorvesper.dev/license
 */
export * from "./Unroll";
export { default } from "./Unroll";
View on GitHubReport an issue