OverlayScrim
Full-viewport backdrop that dims content behind a dialog, drawer or menu. Supports click-to-close and custom background color.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-overlay-scrim> — a single div.origam-scrim positioned fixed with inset: 0. Wrapped in an <origam-transition> (OrigamFade by default).- 1.origam-scrim
- Root element.
position: fixed; inset: 0; opacity: 0.32. Conditionally rendered viav-if="active"wrapped in<origam-transition>. Hasaria-hidden="true".
API
Props
All props accepted by this component, with their type, default value and description.
- activebooleanfalse
- Shows or hides the scrim. When false, the element is removed from the DOM (v-if).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root.
- disabledboolean
- Transition component or config applied around the scrim. Defaults to OrigamFade.
- scrimboolean | stringtrue
- When a string, used as the background-color via useBackgroundColor. When boolean, toggles the scrim visibility. False disables the scrim.
API
Emits
Events emitted by this component.
- @mouseenterMouseEvent
- Fired when the pointer enters the scrim surface.
- @mouseleaveMouseEvent
- Fired when the pointer leaves the scrim surface.
- @clickMouseEvent
- Fired when the scrim is clicked. Typically used to close the parent overlay.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Scrim background color. Aliased to color.overlay.scrim. Overridden inline when scrim prop is a color string.
- Opacity of the backdrop. 0.32 matches Material Design spec.
- Pointer event handling. Set to none to make the scrim click-through.
- Duration of the opacity transition on enter/leave.
- Easing function for the opacity transition.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Escape | Conventionally closes the parent overlay (handled by the parent, not the scrim itself). |
Notes
- The scrim element always carries aria-hidden="true" — it is purely decorative. Screen readers skip it entirely.
- Click events are forwarded to the parent overlay which is responsible for closing and restoring focus.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorvar(--origam-color__overlay---scrim)
- Scrim background. References color.overlay.scrim semantic token.
- numbervar(--origam-opacity---32)
- Default opacity (0.32).
- durationvar(--origam-motion__duration---medium)
- Duration of the opacity fade animation.
- otherfixed
- Positioning strategy — always fixed to cover the viewport.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic scrim
Custom scrim color
Ecosystem
Family
Components from the same folder that share conventions and often compose together.