Staaarter

Feature Spotlight Tabs

A feature section where a row of pill-shaped tab chips switches a large spotlight panel below, showing that tab's image, title, description, and a short checklist. An optional auto-loop advances through the tabs on a timer until a visitor clicks one, at which point the loop stops.

By Staaarter Team
Feature
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/feature-spotlight-tabs.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/feature/feature38.tsx instead.

Usage

The file also exports feature38Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Feature38, feature38Demo } from "@/components/blocks/feature/feature38";

export default function Page() {
  return <Feature38 {...feature38Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall label above the heading; omitted entirely when unset.
headingReactNodenoneSection heading.
tabsSpotlightTab[]noneTab entries; the first is active by default.
autoLoopMsnumberundefinedMilliseconds between automatic tab advances; omit to disable the auto-loop.
classNamestringundefinedExtra classes for the outer section element.

Types

type SpotlightTab = {
  label: string;
  title: string;
  description: string;
  checklist: string[];
  image?: { src: string; alt: string };
};

Behavior notes

  • Real client-side state: clicking a tab chip sets it as the active tab via useState, swapping the spotlight panel's image, title, description, and checklist.
  • Real auto-loop: when autoLoopMs is set, a setInterval started from that fixed literal advances the active tab every autoLoopMs milliseconds; clicking any chip pauses the loop for the rest of the block's lifetime.
  • "use client" component, so its demo props live in the sibling feature38.demo.tsx file per this repo's client/demo-file-split rule, not in feature38.tsx itself.
  • The checklist's check icon is purely decorative; there is no real completion state behind it.