useElevation
Commons
stable
Maps the `elevation` prop to a `--origam-shadow-*` design token. Accepts origam rung names (none/xs/sm/md/lg/xl/2xl/3xl) or Material 0–24 integers. The bgColor parameter is deprecated and ignored since v2.5.
API
Signature
Signature TypeScript complète extraite du fichier du composable.
The bgColor param warned since v2.5 and will be removed in v3.0.0. Remove it from your composable calls to eliminate the console warning.
Interfaces consommées
IElevationProps
API
Paramètres
Paramètres d'entrée acceptés par ce composable.
- propsrequisIElevationProps | Ref<TElevation | undefined>
- Either the component props object (reads `elevation`) or a plain Ref.
- flatRef<boolean>ref(false)
- When true, all shadow output is suppressed regardless of the elevation value.
- bgColorRef<TColor>ref(ELEVATION_LEGACY_BG_COLOR)
- Deprecated since v2.5. Shadows now come from design tokens. The parameter is still accepted to avoid breaking callers but is completely ignored.
- namestringgetCurrentInstanceName()
- Component name prefix for the `{name}--elevated` class.
API
Valeurs de retour
Propriétés et méthodes exposées par l'objet retourné par le composable.
- elevationClasses
- Includes `{name}--elevated` and optionally `origam--shadow-{rung}` utility class when the rung is in the Phase 1 manifest.
- elevationStyles
- Inline `box-shadow: var(--origam-shadow---{rung})` declaration.
Usage
Exemples
Extraits de code prêts à coller.
Card elevation variants