Emboss Surface
A realistic embossed, debossed, plaster or metal-stamped material for text, icons and shapes.
Installation
npx smoothui-cli add emboss-surfaceFeatures
- Four material recipes —
emboss,deboss,plasterandmetal-stamp - Highlight and shade layers derived from
lightAngle,depthandsoftness, so a single angle drives the whole relief plasterswaps the shadow stack for an SVGfeSpecularLightingfilter with a matchingfeDistantLightmetal-stampadds hard zero-blur layers plus adrop-shadowpass so icons and SVG shapes take the same strike- Polymorphic
asprop — emboss a heading, aspan, a button wrapper or any element interactivecouples the light angle to the pointer by writing CSS custom properties directly, with no React re-render per move- Colours are derived with
color-mix, so the relief tracks whatever theme token you pass tocolor
Usage notes
lightAngleis measured in degrees where0is light from the right and90is light from directly above. The default of135puts the light in the upper left, matching the convention most UI shadows use.depthis expressed in pixels andsoftnessruns from0(a hard die edge) to1(a diffuse plaster falloff).colordefaults to thebackgroundtheme token. Pass any CSS colour — including another token — and the highlight and shade are mixed from it.
Accessibility
ARIA Attributes
| Attribute | Element | Purpose |
|---|---|---|
aria-hidden="true" | Filter <svg> | Hides the zero-sized SVG that only carries the plaster filter definition |
Screen Reader
- The relief is entirely presentational: it lives in
box-shadow,text-shadowandfilter, so the rendered text stays real text and is announced normally. - The
asprop keeps semantics in your hands — renderas="h2"for a heading and the element is exposed with the correct role and level. - The filter
<svg>isaria-hidden, zero-sized andpointer-events: none, so it never enters the accessibility tree or the tab order. - Keep enough contrast between
colorand the surrounding surface; relief alone must never be the only signal that something is interactive.
Reduced Motion
This component respects the prefers-reduced-motion media query via useReducedMotion from Motion. When reduced motion is preferred, the pointer listeners for interactive are never attached and the light angle stays fixed at the lightAngle you passed. The box-shadow transition is also removed, so any change applies instantly. The same static behaviour applies on devices that do not match (hover: hover) and (pointer: fine).
Props
Created by
Powered by
© 2026 SmoothUI. Built by Eduardo Calvo.