OverlayScrim
Full-viewport backdrop that dims content behind a dialog, drawer or menu. Supports click-to-close and custom background color.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Événements émis par ce composant.
- @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
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic scrim
Custom scrim color
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.