Expand Hero
Install the component, then paste your configured usage. Your settings are included in the code below.
npx arclen-ui add expand-hero --settings eyJoZWFkaW5nIjoiTGlnaHQgc3R1ZHkuIiwic3VidGl0bGUiOiJBIG1vbWVudCwgaGVsZCBpbiBsaWdodC4iLCJsZWZ0TGFiZWwiOiJMT09LIiwicmlnaHRMYWJlbCI6IkNMT1NFUiIsImZvb3RlciI6IiIsImNyZWRpdCI6IiIsImludml0YXRpb24iOiJTY3JvbGwgdG8gZGlzY292ZXIiLCJpbWFnZSI6IiIsImltYWdlQWx0IjoiQSBmcmVja2xlZCB3b21hbiB3aXRoIGRhcmsgY3VybHMgaW4gcGVhY2ggbGlnaHQgYWdhaW5zdCBhIGJsdWUtZ3JleSBiYWNrZHJvcC4iLCJpbWFnZVBvc2l0aW9uWCI6NTAsImltYWdlUG9zaXRpb25ZIjo1MCwiaGVpZ2h0TW9kZSI6InZpZXdwb3J0Iiwic3RhZ2VIZWlnaHQiOjkwMCwic2Nyb2xsTGVuZ3RoIjozLCJ0aXRsZVNpemUiOjEsImNhbnZhc0NvbG9yIjoiI2VjZTJkNSIsImNhcHRpb25Db2xvciI6IiM0OTNiMzAiLCJ0aXRsZUNvbG9yIjoiI2ZmZmZmZiIsInNoYWRlT3BhY2l0eSI6MC42NSwic2V0dGxpbmciOjQwMCwicmVkdWNlTW90aW9uIjpmYWxzZX0import { ExpandHero } from "@/components/expand-hero";
export default function Example() {
return <ExpandHero {...{
"heading": "Light study.",
"subtitle": "A moment, held in light.",
"leftLabel": "LOOK",
"rightLabel": "CLOSER",
"footer": "",
"credit": "",
"invitation": "Scroll to discover",
"image": "",
"imageAlt": "A freckled woman with dark curls in peach light against a blue-grey backdrop.",
"imagePositionX": 50,
"imagePositionY": 50,
"heightMode": "viewport",
"stageHeight": 900,
"scrollLength": 3,
"titleSize": 1,
"canvasColor": "#ece2d5",
"captionColor": "#493b30",
"titleColor": "#ffffff",
"shadeOpacity": 0.65,
"settling": 400,
"reduceMotion": false
}} />;
}| Property | Type | Default |
|---|---|---|
headingHeading Up to 60 characters | text | "Light study." |
subtitleSubtitle Up to 120 characters | text | "A moment, held in light." |
leftLabelOpening left label Up to 20 characters | text | "LOOK" |
rightLabelOpening right label Up to 20 characters | text | "CLOSER" |
footerClosing caption Up to 100 characters | text | "" |
creditImage credit Up to 80 characters | text | "" |
invitationScroll invitation Up to 60 characters | text | "Scroll to discover" |
imageImage Empty uses the bundled portrait. Explicit custom URLs request your supplied image. | image | "" |
imageAltImage description Up to 240 characters | text | "A freckled woman with dark curls in peach light against a blue-grey backdrop." |
imagePositionXImage horizontal focus 0–100Step 1 | number | 50 |
imagePositionYImage vertical focus 0–100Step 1 | number | 50 |
heightModeStage sizing Options: viewport, fixed | select | "viewport" |
stageHeightFixed stage height Used when Stage sizing is fixed. 320–1200Step 10 | number | 900 |
scrollLengthScroll length Track length as a multiple of stage height. 2–5Step 0.25 | number | 3 |
titleSizeTitle scale 0.65–1.3Step 0.05 | number | 1 |
canvasColorOpening background | color | "#ece2d5" |
captionColorOpening text | color | "#493b30" |
titleColorImage text | color | "#ffffff" |
shadeOpacityImage shading 0–1Step 0.05 | number | 0.65 |
settlingScroll settling Smoothing time constant in milliseconds. Zero follows scroll directly. 0–1000Step 10 | number | 400 |
reduceMotionReduce motion | boolean | false |
Expand Hero
A portrait begins as a small window in a warm canvas. Scrolling opens the image across the stage, then reveals the Light Study heading. The bundled portrait and Playfair Display font are local assets.
import { ExpandHero } from './expand-hero/src/react';
<ExpandHero
heading="A quiet moment."
subtitle="Photographs from the everyday."
footer="Collected in afternoon light."
/>The wrapper accepts every setting plus className, style and paused. React renders readable HTML on the server and mounts one framework-neutral controller. Updating settings retains the current reveal position and the image element; changing unrelated host props does not overwrite the controller's content.
import { mount } from './expand-hero/src/core';
import './expand-hero/src/styles.css';
const hero = mount(host, { heightMode: 'fixed', stageHeight: 700 });
hero.update({ heading: 'Held in light.', settling: 250 });
hero.pause();
hero.resume();
hero.destroy();update replaces the configuration, so include every value you want to retain. pause freezes the reveal and cancels pending frames; resume follows the current scroll position. destroy removes its markup, observers, listeners and pending frame, and is safe to repeat. Multiple instances keep separate progress.
The stage fills 100svh by default. Choose fixed stage sizing to use stageHeight in pixels. The track is three stage heights by default; scrollLength changes that travel distance. The host or nearest ancestor with vertical auto, scroll or hidden overflow supplies the sticky scroll origin. Give an independent scrolling region a definite height and keyboard access. overflow: clip does not establish a scrollport.
Layout follows the component's width. On narrow containers the opening labels move above and below the portrait and the title uses a larger proportion of the width. Keep titles and captions brief. Image focus controls set the crop's horizontal and vertical position. Image shading helps maintain text contrast; custom palettes and imagery need a contrast check in their final context.
Content settings replace each visible label. Closing caption and image credit are empty by default; add them when needed. Empty text hides that label's content. Empty image uses the bundled portrait; a supplied image URL is requested only when explicitly configured. Set imageAlt to describe the replacement, or use an empty string for a decorative image. Raster data URLs and browser-accessible blob URLs are supported alongside HTTPS and local paths; executable URLs and SVG data URLs are rejected.
The settling value is a smoothing time constant in milliseconds. Zero follows scroll directly. Native wheel, keyboard and touch scrolling remain available. Work runs only while the reveal is moving and the component is visible. Hidden documents and offscreen ancestors suspend drawing.
Reduced motion displays the final composition and shortens the track to one stage. This also works through the system preference. Browsers without preference detection use the still composition. Server output and HTML without JavaScript show a readable final composition. If the image fails, a dark backing preserves the title; the font uses font-display: swap and has a local serif fallback.
The portrait was generated with Codex image generation on 2026-11-06. Its generation disclosure and exact hash are in assets/image-provenance.json. Playfair Display is compressed to WOFF2 without changing glyphs or names and distributed under SIL OFL 1.1; retain its accompanying notice. The component code uses the MIT licence included in the package.
The preview runs the component’s own JavaScript. It respects reduced motion and pauses when off screen. The HTML bundle includes a static fallback.
Every setting in this panel comes from the component manifest. Preview size, pause and replay stay in the inspector.