Effects
Use Honest UI's shadow, focus, pressed-state, motion, and blur tokens without compromising feedback or accessibility.
Effects explain depth, focus, and change. Honest UI gives these decisions named tokens so a popover, button, and dialog can use the same visual language without copying long shadow or transition values.
Use effects to reinforce behavior. They should not be the only way a person can identify a state or understand what changed.
Shadows
Shadows resolve to different values in light and dark themes. The role stays the same, while the shadow color and intensity adapt to the active surface.
Elevation is relational. A floating surface only needs enough separation to remain understandable against the surfaces beneath it.
Focus and pressed feedback
Focus tokens keep keyboard indicators consistent. Use the outline form for most controls and the shadow form for a borderless text-entry surface where an outline would not fit the component structure.
Never remove the visible focus indicator without replacing it. Confirm that the complete control remains visible at 200% and 400% zoom and that the ring is not hidden by clipping, sticky content, or an overlay.
Motion
The duration and easing tokens cover the interaction speeds used by Honest UI components.
Wrap nonessential motion in a reduced-motion query. The state change must remain understandable when the transition is removed.
<button
className="
motion-safe:[transition:var(--hui-transition-interactive)]
motion-safe:active:scale-[var(--hui-scale-pressed)]
motion-safe:active:[transition:var(--hui-transition-pressed)]
"
>
Apply filters
</button>Blur
Blur tokens are filters, not distances. Apply them to filter or backdrop-filter and provide an opaque-enough surface or fallback so content remains legible when backdrop filtering is unavailable.
Each preview keeps the left half sharp and applies the listed backdrop blur to the right half.
<div
className="
border border-[var(--hui-color-border-base-primary)]
bg-[var(--hui-color-background-base-primary)]
shadow-[var(--hui-shadow-floating)]
[backdrop-filter:var(--hui-blur-xl)]
supports-[backdrop-filter:blur(1px)]:bg-[var(--hui-color-overlay-white-a8)]
"
/>Practical guidance
- Use the lowest elevation that communicates the layer relationship.
- Keep focus feedback immediate and visible; do not animate it into view.
- Do not place moving blur behind text if it reduces readability or increases distraction.
- Pause or remove looping decorative animation, and honor
prefers-reduced-motion. - Verify dark theme, forced colors, keyboard focus, and fallbacks with blur and animation disabled.