Staaarter

Icon Strip + Detail Card over Media

A centered header sits above a horizontal strip of icon pills, one per feature. Clicking a pill sets it active and swaps the single detail card below to that feature's icon, heading, description, and stat, all floating over a full-bleed background photo darkened by a semi-transparent overlay.

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/icon-strip-detail-card-over-media.json

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

Usage

The file also exports feature85Demo, 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 { Feature85, feature85Demo } from "@/components/blocks/feature/feature85";

export default function Page() {
  return <Feature85 {...feature85Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall centered label above the heading.
headingReactNodenoneCentered section heading.
descriptionstringundefinedCentered supporting paragraph.
backgroundImageMediaSlotImagenoneFull-bleed photo behind the whole section, darkened by an overlay.
itemsDetailStripItem[]noneFeatures shown in the icon strip, in array order; item 0 is active on mount.
classNamestringnoneExtra classes for the outer section element.

Types

interface DetailStripItem {
  title: string;
  description: string;
  stat: { value: string; label: string };
}

Behavior notes

  • Real client-side state: clicking an icon pill in the strip sets `activeIndex`, which swaps the icon, heading, description, and stat shown in the single detail card below - a direct index toggle, not an accordion, so exactly one detail card is ever rendered at a time.
  • The first item (index 0) is active by default on mount.
  • Each pill's icon comes from a fixed, hardcoded set indexed by item position rather than a per-item icon prop, since a "use client" component can't accept a component reference from a server parent.
  • role="tablist"/role="tab"/role="tabpanel" with aria-selected and aria-controls wire the strip to the detail panel for screen readers.
  • Demo props live in a separate feature85.demo.tsx file (no "use client" directive) per this repo's client/demo-props split rule, so the plain demo object is never re-exported through the client module.