Modus UI

True Focus

Web (React)

A typographic animation that moves a camera-like focus frame between words while blurring the rest.

A typographic animation that moves a camera-like focus frame between words while blurring the rest. It supports both automatic interval scrolling and manual hover modes.

Installation

CLI

npx @modus-ui/cli add true-focus

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/true-focus.tsx.
  3. Paste the code.

Usage

tsx
import { TrueFocus } from "@/components/ui/true-focus";

export default function Example() {
  return (
    <TrueFocus
      sentence="Focus On What Matters"
      manualMode={false}
      blurAmount={4}
      borderColor="hsl(var(--primary))"
      animationDuration={0.6}
      pauseBetweenAnimations={1.5}
    />
  );
}

Props

PropTypeDefaultDescription
sentencestring"True Focus"The sentence to render.
separatorstring" "String the sentence is split on.
manualModebooleanfalseFocuses the hovered word instead of cycling automatically.
blurAmountnumber5Blur in pixels on unfocused words.
borderColorstring"hsl(var(--primary))"Colour of the focus frame corners.
glowColorstring"hsl(var(--primary) / 0.6)"Glow colour around the focus frame.
animationDurationnumber0.5Seconds the focus frame takes to move.
pauseBetweenAnimationsnumber1Seconds between automatic moves.

Comments

  • No comments yet.