GooseUI

Components

Silhouette Reveal

New

Shows an image as a solid silhouette and smoothly reveals it on click, on hover or from your state. The silhouette is a CSS mask cut from the image itself and filled with the text color, so it stays visible in both light and dark themes. It is a server component with no JavaScript: a click checks a hidden checkbox, hover is :hover and :focus-visible, and :has() switches the layers.

Browser Support

Masks

Reveals the image through a silhouette.

Your browser:
:has()

Changes the reveal on interaction.

Your browser:

Preview

Who is it?
Pick the right name for the silhouette
Round 1 of 4Score: 0
Hidden imageOwl

Installation

npx shadcn@latest add @gooseui/silhouette-reveal
pnpm dlx shadcn@latest add @gooseui/silhouette-reveal
yarn dlx shadcn@latest add @gooseui/silhouette-reveal
bunx --bun shadcn@latest add @gooseui/silhouette-reveal

Usage

import { SilhouetteReveal } from "@/components/ui/silhouette-reveal"

export default function Example() {
  return (
    <SilhouetteReveal
      src="/images/mascot.png"
      alt="Our mascot"
      className="size-48"
    />
  )
}

Examples

Guess who

A quiz round: the silhouette stays hidden until the right answer. trigger="manual" with your own state, so a wrong answer can shake the card and a right one sets revealed.

Who is it?
Pick the right name for the silhouette
Round 1 of 4Score: 0
Hidden imageOwl
const [solved, setSolved] = useState(false)

<SilhouetteReveal
  src="/images/owl.svg"
  alt="Owl"
  trigger="manual"
  revealed={solved}
  className="size-64"
/>
{options.map((option) => (
  <Button
    key={option.id}
    variant="outline"
    onClick={() => {
      if (option.id === "owl") {
        setSolved(true)
        customToast.success("Correct! It's an owl")
      } else {
        customToast.error("Not quite, try again")
      }
    }}
  >
    {option.name}
  </Button>
))}

Hidden prize

A gift card with a hidden product. The button flips revealed, and the promo code appears together with the image.

Your gift is waiting
Open the box to see what you won
Gift
Hidden imageWireless headphones
const [open, setOpen] = useState(false)

<Card>
  <CardHeader>
    <CardTitle>Your gift is waiting</CardTitle>
    <Badge variant="beta">Gift</Badge>
  </CardHeader>
  <CardContent>
    <SilhouetteReveal
      src="/images/headphones.svg"
      alt="Wireless headphones"
      trigger="manual"
      revealed={open}
      duration={1100}
      className="size-44"
    />
    {open && <code>GOOSE-2026</code>}
  </CardContent>
  <CardFooter>
    <Button onClick={() => setOpen(true)}>Open the gift</Button>
  </CardFooter>
</Card>

Collection teaser

Three "Soon" cards. trigger="hover" needs no state at all, and the product name unblurs with :has() on the same hover.

New collection

Hover a card to peek at what is coming

Hidden imageTrail sneaker

Trail sneaker

Soon

12 Dec

Hidden imageCity backpack

City backpack

Soon

19 Dec

Hidden imageDesk lamp

Desk lamp

Soon

26 Dec

<Card className="group/drop">
  <CardContent>
    <SilhouetteReveal
      src="/images/sneaker.svg"
      alt="Trail sneaker"
      trigger="hover"
      duration={500}
      className="size-32"
    />
    {/* Unblurs while the image inside is hovered or focused */}
    <p className="blur-sm transition-[filter] group-has-[[data-gooseui-silhouette]:is(:hover,:focus-visible)]/drop:blur-none">
      Trail sneaker
    </p>
    <Badge variant="info" size="sm">Soon</Badge>
  </CardContent>
</Card>

Achievements

Locked achievements stay a muted silhouette, the unlocked one is revealed. The silhouette color comes from silhouetteClassName.

Achievements
Complete tasks to unlock the rest
Hidden imageFirst win

First win

Win your first match

Unlocked
Hidden imageOn fire

???

Play 7 days in a row

5 / 7
Hidden imageVeteran

???

Play 100 matches

42 / 100
{achievements.map((item) => (
  <div key={item.id}>
    <SilhouetteReveal
      src={item.image}
      alt={item.name}
      trigger="manual"
      revealed={item.done}
      silhouetteClassName="text-muted-foreground/35"
      className="size-24"
    />
    <p>{item.done ? item.name : "???"}</p>
    <Badge variant={item.done ? "success" : "neutral"}>
      {item.done ? "Unlocked" : item.progress}
    </Badge>
  </div>
))}

Props

PropTypeDefaultDescription
srcstring-Image URL, ideally with a transparent background
altstring-Alt text shown after the reveal
revealedboolean-Reveal from outside; with manual it is the only switch
defaultRevealedbooleanfalseStart revealed in click mode
trigger"click" | "hover" | "manual""click"What reveals the image
durationnumber700Transition duration in ms
namestring-Name of the click checkbox, so the state reaches FormData
silhouetteClassNamestring-Classes for the silhouette, set its color with text-*
imageClassNamestring-Classes for the <img> element
labelsPartial<SilhouetteRevealLabels>EnglishTrigger label and alt text while hidden
classNamestring-Classes for the root. Give it a size, for example size-48

Features

  • Theme-safe silhouette: a mask filled with currentColor instead of brightness(0), so it never disappears on a dark background
  • No spoilers: while hidden, the image alt is replaced with a neutral text
  • Three triggers: click, hover with focus, or manual control
  • No JavaScript: the reveal works before hydration and with scripts turned off. To react to it, listen to the change event that bubbles from the checkbox
  • Accessible: click mode is a labelled checkbox, Space reveals it, hover mode reacts to keyboard focus
  • Reduced motion: the reveal happens without the transition