Staaarter

Click-to-Swap Sticky Thread List

Two-column feature section: an optional eyebrow and heading sit above a vertical list of clickable thread buttons on the left. Clicking a thread swaps the sticky image panel on the right; the active thread carries full-emphasis text, a left accent border, and its description expanded beneath it.

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/click-to-swap-thread-list.json

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

Usage

The file also exports feature35Demo, 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 { Feature35, feature35Demo } from "@/components/blocks/feature/feature35";

export default function Page() {
  return <Feature35 {...feature35Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedKicker label above the heading; omitted entirely when unset.
headingReactNodeundefinedSection heading; omitted entirely when unset.
threadsThreadItem[]noneClickable thread entries; the first is active by default.
classNamestringnoneExtra classes for the outer section element.

Types

type ThreadItem = {
  title: string;
  description: string;
  photo: { src: string; alt: string };
};

Behavior notes

  • Real interactivity: clicking a thread button sets it as active via useState, swapping the sticky image panel's photo and expanding that thread's description; this is genuine local state, not decorative.
  • "use client" component, so its demo props live in the sibling feature35.demo.tsx file per this repo's client/demo-file-split rule, not in feature35.tsx itself.
  • The image panel uses `lg:sticky lg:top-24` so it stays in view alongside the thread list while scrolling on larger screens; it is not sticky on mobile where the layout stacks.
  • The active thread's left border and full-emphasis text are the only visual cue for selection; inactive threads show muted text and no border until hovered.