Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultGallery & imagesCapsule Image Hero
Block Wipe Text RevealBrowse all 182Expanding Card Modal
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Capsule Image Hero

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • CustomEase
  • SplitText

Setup

npm i gsapregisterPlugin(CustomEase, SplitText)

More like this

  • Hero
  • Reveal
  • Expand
  • Split text

Features.

  • Two halves of one giant word rise into place letter by letter, each through its own mask
  • A rounded capsule opens from a slit between them, shoving the halves out to the screen edges
  • The image settles from 1.12 to 1 as the capsule opens, then drifts slowly (to 1.04 and back over 24s)
  • Click the capsule or its pill to grow it to the full screen; click again, use the pill or press Escape to close
  • The letters ride the capsule's edges, so they leave ahead of it and come back with it
  • On mouse devices a frosted View / Close pill follows the cursor over the image; on touch it sits at the capsule's centre-right
  • Optional corner text fades out while open, and an optional caption pill fades in
  • Under 768px the halves move to top and bottom bands and slide out on their own
  • Re-fits the resting capsule on resize
  • Respects prefers-reduced-motion: no drift, and every step happens instantly
  • GSAP, CustomEase and SplitText, with one CSS clip-path for the capsule

How to get it right.

Split a short word

Two to five letters a side. The halves are sized to 44% of the viewport height (capped by width), so long halves leave no room for the capsule between them.

Choose an image that crops well

The capsule shows the middle of the image at rest and all of it when open. Set object-position on .cph_img so the subject sits inside the capsule.

Corner text is optional

It ships without any. To add some, put data-cph-corner on text along the bottom edge (.cph_meta and .cph_text are styled for it), and data-cph-caption on a .cph_caption for the open state. Keep it short: it sits on top of nothing but the page.

Use it once, at the top

It fills the viewport (100dvh) and plays as soon as fonts are ready. It's meant as the first screen of a page.

Variations.

  • Tight — data-au-gap="0.5": the letters hug the capsule
  • Long run-up — data-au-pull="30": the halves start closer together and travel further
  • Still image — data-au-drift="1"
  • Your colours — override --cph-bg, --cph-fg, --cph-glass and --cph-accent on .cph_hero

Where it fits.

  • Campaign and launch pages — one word, one image, a reason to click
  • Photographers and studios — a hero that opens into the work
  • Product reveals — the capsule as a window onto the thing
  • Editorial covers — a feature's title word split around its lead photo

Frequently asked.

The script only moves the media wrapper and scales [data-cph-img]. A <video> with data-cph-img inside [data-cph-media] gets the same drift, but playback is up to you.

The whole word is a visually hidden <h1>; the halves are aria-hidden. The pill is a real button with aria-expanded and a label that changes between "View the full image" and "Close the full image", and Escape closes it.

Nothing until you close it. Closing re-measures, so the capsule shrinks back to the right size for the new screen.

Each [data-au-capsule-hero] is its own instance, but Escape closes every open one. It's designed as a single hero.

Related components.

Pro

File Drawer Cards

Hover

Pro

Depth Fly-Through Hero

Load

Pro

Draggable Brick Grid

Drag