For Tailwind CSS v3 docs, click here.

Focus

Highlight words in a sentence with a dynamic blurred effect and animated focus frame. Supports auto-cycling or manual hover focus mode.

API

Prop NameTypeDefaultDescription
sentencestring"Inspira Focus"Text sentence to display and animate word-by-word.
manualModebooleanfalseIf true, focus highlights on hover; otherwise auto-cycles.
blurAmountnumber5Blur radius in pixels for inactive words.
borderColorstring"green"Color of the animated focus frame border.
animationDurationnumber0.5Duration in seconds for the focus frame animation transitions.
pauseBetweenAnimationsnumber1Pause duration in seconds between auto-focus transitions.

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/focus.json"

Install Manually

Copy and paste the following code:

Focus.vue

Features

  • Word-by-word focus: Highlights individual words in a sentence with blur on inactive words.
  • Auto or manual mode: Cycle focus automatically or control it with mouse hover.
  • Animated focus frame: Smoothly animates a border frame around the focused word.
  • Customizable styling: Configure blur amount, border color, and animation timing.
  • Responsive layout: Supports flexible wrapping and alignment of words.

Credits