Skip to documentation content

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.

Honest UI shadow tokens
PreviewTokenValue
--hui-shadow-featherSubtle elevation for cards and resting controlsTheme-aware
--hui-shadow-softInteractive controls, menus, and small floating surfacesTheme-aware
--hui-shadow-liftedPopovers, dropdowns, and notification toastsTheme-aware
--hui-shadow-floatingDialogs and prominent floating surfacesTheme-aware
--hui-shadow-insetPressed or recessed statesTheme-aware inset
--hui-shadow-keyThe hard bottom edge under a raised controlTheme-aware

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.

Honest UI focus and pressed-state tokens
TokenValue
--hui-focus-ringDefault visible keyboard-focus outline2px solid accent emphasis
--hui-focus-ring-shadowFocus indicator for borderless input surfaces0 0 0 2px accent emphasis
--hui-focus-ring-offset-accentMoves a ring outside an accent-filled control2px
--hui-focus-ring-offset-insetPulls a ring inside a clipped control-2px
--hui-focus-ring-offset-inset-borderPulls a ring just inside a bordered control-1px
--hui-scale-pressedPressed feedback for buttons, tabs, and larger controls0.98
--hui-scale-pressed-strongPressed feedback for compact controls such as checks and chips0.94

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.

Honest UI duration tokens
TokenValue
--hui-duration-pressImmediate pointer-down feedback100ms
--hui-duration-fastTooltips, menus, and small popups150ms
--hui-duration-normalPopovers, dialogs, switches, and common state changes200ms
--hui-duration-moderateIndicators, previews, and stepped changes250ms
--hui-duration-slowToast movement and larger transitions400ms
--hui-duration-drawerDrawer and sheet movement450ms
Honest UI easing and transition tokens
TokenValue
--hui-ease-outEntrances, exits, and value changescubic-bezier(0.22, 1, 0.36, 1)
--hui-ease-in-outElements moving between positionscubic-bezier(0.77, 0, 0.175, 1)
--hui-ease-drawerDrawer and sheet movementcubic-bezier(0.32, 0.72, 0, 1)
--hui-transition-interactiveDefault color, border, shadow, and opacity feedback200ms interactive properties
--hui-transition-pressedFast active-state response100ms interactive properties and transform

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.

Honest UI blur tokens
PreviewTokenValue
--hui-blur-smVery subtle separationblur(0.5px)
--hui-blur-mdSoft translucent surface treatmentblur(1px)
--hui-blur-lgNoticeable backdrop separationblur(2px)
--hui-blur-xlStrong backdrop treatment for overlaysblur(4px)
<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.