Scrim

A light, unblurred veil over the page behind a panel that is not a modal.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/scrim.json

Usage

import { Scrim } from "@/components/ui/scrim"

Examples

Default

Keep it mounted and drive open from the panel's own state, so it fades out as well as in. While open it catches clicks, so a click on the page closes the panel instead of pressing a dimmed control.

API Reference

PropTypeDefaultDescription
open*booleanNoneShown and catching clicks while true; faded out and click-through while false. Fades on the motion roles; reduced motion drops the fade.
onClick(event) => voidNoneOptional. For a panel with no outside-click handling of its own, close it here.
open*booleanShown and catching clicks while true; faded out and click-through while false. Fades on the motion roles; reduced motion drops the fade.
onClick(event) => voidOptional. For a panel with no outside-click handling of its own, close it here.