Account

Chrome

Creative

Focus Frame

It follows hover and keyboard focus across items and settles back on the current one. Nav bars, options and grids feel connected.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add focus-frame

Usage

Example
import { FocusFrame } from "@/components/galactrex/focus-frame";

<FocusFrame look="fill"><a aria-current="page">Home</a><a>Work</a></FocusFrame>

Source

Installs to components/galactrex/focus-frame.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
childrenReactNode—Items: direct children or [data-focus-item].
look"outline" | "fill" | "underline""outline"Frame style.
restOnstring—Selector of the current item to rest on.
classNamestring—Extra classes for the outer element.

Variants

  • Nav. Fill behind links, resting on aria-current.
  • Grid. Outline gliding over cards.

Accessibility

  • Follows keyboard focus; the frame is decorative.

Motion and reduced motion

  • One spring-animated box.
  • Reduced motion: jumps.