unlumen

Highlight

Component 7

About

An animated highlight component that tracks active or hovered elements with smooth spring animations, supporting parent and children modes.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Highlight to your project and fits it to your theme.

Code

How Highlight is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import {
  Highlight,
  HighlightItem,
} from "@/components/ui/highlight";

const ITEMS = [
  { id: "react", label: "React" },
  { id: "vue", label: "Vue" },
  { id: "svelte", label: "Svelte" },
  { id: "next", label: "Next.js" },
];

export const HighlightDemo = ({ hover = true }: { hover?: boolean }) => {
  return (
    <div className="flex items-center justify-center min-h-[300px] w-full p-8">
      <Highlight
        mode="parent"
        hover={hover}
        defaultValue={hover ? undefined : "react"}
        className="rounded-lg bg-muted"
        containerClassName="flex gap-3 p-4 flex-wrap justify-center"
      >
        {ITEMS.map((item) => (
          <HighlightItem
            key={item.id}
            value={item.id}
            className="px-4 py-2 rounded-md font-medium cursor-pointer"
          >
            <div>{item.label}</div>
          </HighlightItem>
        ))}
      </Highlight>
    </div>
  );
};

export default HighlightDemo;

Dependencies

More by unlumen

View all
  • Motion Navigation Menu

    Motion Navigation Menu

    279
  • Side By Side Slide

    Side By Side Slide

    240
  • Scroll Reveal Image

    Scroll Reveal Image

    230
  • Count Up

    Count Up

    157
  • Pixel Liquid Background

    Pixel Liquid Background

    110
  • Glow Button

    Glow Button

    100
  • Animated Sidebar

    Animated Sidebar

    98
  • Horizontal Depth Fade

    Horizontal Depth Fade

    78