Staaarter

Photo Callout Markers

A wide photograph carries numbered pin markers placed by percentage coordinates, paired with a ruled list beside it. Selecting a marker on the photo or a row in the list highlights both together: the row's number becomes a filled seal, its rule darkens, and its text moves from muted to full contrast.

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/photo-callout-markers.json

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

Usage

The file also exports feature22Demo, 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 { Feature22, feature22Demo } from "@/components/blocks/feature/feature22";

export default function Page() {
  return <Feature22 {...feature22Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall label above the heading.
headingReactNodenoneSection heading.
descriptionstringundefinedSupporting paragraph under the heading.
photo{ src: string; alt: string }noneWide photo the markers are pinned to.
markersFeature22Marker[]noneNumbered callouts; the first entry is selected by default.
classNamestringnoneExtra classes for the outer section element.

Types

interface Feature22Marker {
  id: string;
  number: number;
  x: number; // percentage from the left edge of the photo, 0-100
  y: number; // percentage from the top edge of the photo, 0-100
  title: string;
  description: string;
}

Behavior notes

  • Real interactivity: clicking a numbered pin on the photo or a row in the list updates one shared piece of local state; the two stay in sync no matter which side you click.
  • The selected row's marker number renders as a filled seal (solid background instead of an outline), its top rule switches to a darker border color, and its title switches from text-muted-foreground to full text-foreground.
  • Marker position is plain percentage-based absolute positioning, it does not account for image cropping at odd aspect ratios beyond the fixed 16:10 the photo is displayed at.
  • The first marker in the array is selected by default; there is no prop to control the initial selection from outside the component.