Staaarter

Principles Selector

A two-column interactive block: a vertical list of principle titles on the left, and a detail panel on the right showing the active principle's description and photo. Hovering or focusing a list item makes it active.

By Staaarter Team
Agency
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/principles-selector.json

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

Usage

The file also exports agency17Demo, 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 { Agency17, agency17Demo } from "@/components/blocks/agency/agency17";

export default function Page() {
  return <Agency17 {...agency17Demo} />;
}

Props

PropTypeDefaultDescription
headingstringundefinedOptional heading above the two-column layout.
descriptionstringundefinedOptional supporting text under the heading.
principlesPrincipleItem[]noneList of selectable principles, in display order. The first item is active by default.
classNamestringnoneExtra classes for the outer section element.

Types

type PrincipleItem = {
  title: string;
  description: string;
  photo: MediaSlotImage;
};

Behavior notes

  • This is the interactive block in this batch: it's a `"use client"` component with real `useState`, not a static prop. Hovering (`onMouseEnter`) or focusing (`onFocus`, for keyboard users) a list row sets it as the active index and re-renders the detail panel's description and photo.
  • Default active index is 0, so the first principle's detail and photo show on initial render, before any hover/focus interaction.
  • The list buttons are `type="button"`, not real submits, so they only drive local UI state and never trigger navigation or form submission.
  • The demo props live in a sibling `agency17.demo.tsx` file (not exported from the client component file itself), per this repo's rule that a `"use client"` module's other exports become opaque client references when imported from server code, which would otherwise break the live preview.