# Effects

> Use Honest UI's shadow, focus, pressed-state, motion, and blur tokens without compromising feedback or accessibility.

Source: https://www.honestui.com/docs/theme/effects

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]

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.

<TokenTable
  caption="Honest UI shadow tokens"
  type="shadow"
  tokens="[
  { name: &#x22;--hui-shadow-feather&#x22;, value: &#x22;Theme-aware&#x22;, description: &#x22;Subtle elevation for cards and resting controls&#x22; },
  { name: &#x22;--hui-shadow-soft&#x22;, value: &#x22;Theme-aware&#x22;, description: &#x22;Interactive controls, menus, and small floating surfaces&#x22; },
  { name: &#x22;--hui-shadow-lifted&#x22;, value: &#x22;Theme-aware&#x22;, description: &#x22;Popovers, dropdowns, and notification toasts&#x22; },
  { name: &#x22;--hui-shadow-floating&#x22;, value: &#x22;Theme-aware&#x22;, description: &#x22;Dialogs and prominent floating surfaces&#x22; },
  { name: &#x22;--hui-shadow-inset&#x22;, value: &#x22;Theme-aware inset&#x22;, description: &#x22;Pressed or recessed states&#x22; },
  { name: &#x22;--hui-shadow-key&#x22;, value: &#x22;Theme-aware&#x22;, description: &#x22;The hard bottom edge under a raised control&#x22; },
]"
/>

Elevation is relational. A floating surface only needs enough separation to remain understandable against the surfaces beneath it.

## Focus and pressed feedback [#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.

<TokenTable
  caption="Honest UI focus and pressed-state tokens"
  tokens="[
  { name: &#x22;--hui-focus-ring&#x22;, value: &#x22;2px solid accent emphasis&#x22;, description: &#x22;Default visible keyboard-focus outline&#x22; },
  { name: &#x22;--hui-focus-ring-shadow&#x22;, value: &#x22;0 0 0 2px accent emphasis&#x22;, description: &#x22;Focus indicator for borderless input surfaces&#x22; },
  { name: &#x22;--hui-focus-ring-offset-accent&#x22;, value: &#x22;2px&#x22;, description: &#x22;Moves a ring outside an accent-filled control&#x22; },
  { name: &#x22;--hui-focus-ring-offset-inset&#x22;, value: &#x22;-2px&#x22;, description: &#x22;Pulls a ring inside a clipped control&#x22; },
  { name: &#x22;--hui-focus-ring-offset-inset-border&#x22;, value: &#x22;-1px&#x22;, description: &#x22;Pulls a ring just inside a bordered control&#x22; },
  { name: &#x22;--hui-scale-pressed&#x22;, value: &#x22;0.98&#x22;, description: &#x22;Pressed feedback for buttons, tabs, and larger controls&#x22; },
  { name: &#x22;--hui-scale-pressed-strong&#x22;, value: &#x22;0.94&#x22;, description: &#x22;Pressed feedback for compact controls such as checks and chips&#x22; },
]"
/>

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 [#motion]

The duration and easing tokens cover the interaction speeds used by Honest UI components.

<TokenTable
  caption="Honest UI duration tokens"
  tokens="[
  { name: &#x22;--hui-duration-press&#x22;, value: &#x22;100ms&#x22;, description: &#x22;Immediate pointer-down feedback&#x22; },
  { name: &#x22;--hui-duration-fast&#x22;, value: &#x22;150ms&#x22;, description: &#x22;Tooltips, menus, and small popups&#x22; },
  { name: &#x22;--hui-duration-normal&#x22;, value: &#x22;200ms&#x22;, description: &#x22;Popovers, dialogs, switches, and common state changes&#x22; },
  { name: &#x22;--hui-duration-moderate&#x22;, value: &#x22;250ms&#x22;, description: &#x22;Indicators, previews, and stepped changes&#x22; },
  { name: &#x22;--hui-duration-slow&#x22;, value: &#x22;400ms&#x22;, description: &#x22;Toast movement and larger transitions&#x22; },
  { name: &#x22;--hui-duration-drawer&#x22;, value: &#x22;450ms&#x22;, description: &#x22;Drawer and sheet movement&#x22; },
]"
/>

<TokenTable
  caption="Honest UI easing and transition tokens"
  tokens="[
  { name: &#x22;--hui-ease-out&#x22;, value: &#x22;cubic-bezier(0.22, 1, 0.36, 1)&#x22;, description: &#x22;Entrances, exits, and value changes&#x22; },
  { name: &#x22;--hui-ease-in-out&#x22;, value: &#x22;cubic-bezier(0.77, 0, 0.175, 1)&#x22;, description: &#x22;Elements moving between positions&#x22; },
  { name: &#x22;--hui-ease-drawer&#x22;, value: &#x22;cubic-bezier(0.32, 0.72, 0, 1)&#x22;, description: &#x22;Drawer and sheet movement&#x22; },
  { name: &#x22;--hui-transition-interactive&#x22;, value: &#x22;200ms interactive properties&#x22;, description: &#x22;Default color, border, shadow, and opacity feedback&#x22; },
  { name: &#x22;--hui-transition-pressed&#x22;, value: &#x22;100ms interactive properties and transform&#x22;, description: &#x22;Fast active-state response&#x22; },
]"
/>

Wrap nonessential motion in a reduced-motion query. The state change must remain understandable when the transition is removed.

```tsx
<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]

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.

<TokenTable
  caption="Honest UI blur tokens"
  type="blur"
  tokens="[
  { name: &#x22;--hui-blur-sm&#x22;, value: &#x22;blur(0.5px)&#x22;, description: &#x22;Very subtle separation&#x22; },
  { name: &#x22;--hui-blur-md&#x22;, value: &#x22;blur(1px)&#x22;, description: &#x22;Soft translucent surface treatment&#x22; },
  { name: &#x22;--hui-blur-lg&#x22;, value: &#x22;blur(2px)&#x22;, description: &#x22;Noticeable backdrop separation&#x22; },
  { name: &#x22;--hui-blur-xl&#x22;, value: &#x22;blur(4px)&#x22;, description: &#x22;Strong backdrop treatment for overlays&#x22; },
]"
/>

```tsx
<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 [#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.
