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

Full TypeScript signature sourced from the composable file.

typescript

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.

Consumed interfaces

IElevationProps

API

Parameters

Input parameters accepted by this composable.

props
required
IElevationProps | Ref<TElevation | undefined>
Either the component props object (reads `elevation`) or a plain Ref.
flat
Ref<boolean>
ref(false)
When true, all shadow output is suppressed regardless of the elevation value.
bgColor
Ref<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.
name
string
getCurrentInstanceName()
Component name prefix for the `{name}--elevated` class.

API

Return values

Properties and methods exposed by the composable return object.

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

Examples

Ready-to-paste usage snippets.

Card elevation variants

vue