# Location 1

> One tall feature card beside a grid of photo location cards (from Marbrook)

A shadcn/ui block from the [@cnippet-blocks](https://blocks.cnippet.dev/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet-blocks/location-1).

- Page, with a live preview: https://shadcn.exchange/r/cnippet-blocks/location-1
- Screenshot: https://shadcn.exchange/shot/cnippet-blocks/location-1/light.png
- Registry item: https://blocks.cnippet.dev/r/location-1.json
- Categories: location
- Listed: 2026-11-01, source last changed 2026-11-01

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet-blocks/location-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `@cnippet/utils`

## Files

### `registry/default/sections/location-1/index.tsx`

```tsx
import { ArrowUpRight } from "lucide-react";
import Image from "next/image";
import Link from "next/link";

import { cn } from "@/lib/utils";

import type { Surface } from "../_types/common";
import type { LocationContent } from "../_types/location";
import { defaultLocation1Content } from "./data";
import {
  eyebrowClass,
  SectionHeader,
  surfaceClass,
  toneFor,
} from "./section-header";

/** One tall feature card beside a two-across grid of smaller photo cards. */
export default function Location1({
  content = defaultLocation1Content,
  surface = "default",
}: {
  content?: LocationContent;
  surface?: Surface;
}) {
  const [feature, ...rest] = content.items;

  return (
    <section className={cn("py-20 sm:py-28", surfaceClass[surface])}>
      <div className="mx-auto max-w-7xl px-5 sm:px-8 lg:px-12">
        <SectionHeader
          action={
            content.action && (
              <Link
                className="group inline-flex items-center gap-2 text-primary text-sm underline-offset-4 hover:underline"
                href={content.action.href}
              >
                {content.action.label}
                <ArrowUpRight className="size-4 transition-transform duration-300 group-hover:translate-x-0.5 group-hover:-translate-y-0.5" />
              </Link>
            )
          }
          description={content.description}
          eyebrow={content.eyebrow}
          title={content.title}
          tone={toneFor(surface)}
        />

        {feature && (
          <div className="mt-10 grid gap-4 lg:grid-cols-12">
            <Link
              className="group relative flex min-h-80 flex-col justify-end overflow-hidden rounded-lg lg:col-span-6 lg:min-h-136"
              href={feature.href}
            >
              <Image
                alt={feature.image.alt}
                className="object-cover transition-transform duration-700 ease-out group-hover:scale-105"
                fill
                sizes="(min-width: 1024px) 50vw, 100vw"
                src={feature.image.src}
              />
              <div className="absolute inset-0 bg-linear-to-t from-primary/90 via-primary/30 to-transparent" />
              <div className="relative p-7 lg:p-9">
                <p className={cn(eyebrowClass, "text-white/60")}>
                  {feature.label}
                </p>
                <h3 className="mt-3 font-display text-3xl text-white lg:text-4xl">
                  {feature.name}
                </h3>
                <p className="mt-2 max-w-sm text-sm text-white/70 leading-relaxed">
                  {feature.description}
                </p>
              </div>
            </Link>

            <div className="grid gap-4 sm:grid-cols-2 lg:col-span-6">
              {rest.map((item) => (
                <Link
                  className="group relative flex min-h-56 flex-col justify-end overflow-hidden rounded-lg"
                  href={item.href}
                  key={item.href}
                >
                  <Image
                    alt={item.image.alt}
                    className="object-cover transition-transform duration-700 ease-out group-hover:scale-105"
                    fill
                    sizes="(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw"
                    src={item.image.src}
                  />
                  <div className="absolute inset-0 bg-linear-to-t from-primary/90 via-primary/25 to-transparent" />
                  <div className="relative p-6">
                    <p className={cn(eyebrowClass, "text-white/60")}>
                      {item.label}
                    </p>
                    <h3 className="mt-2 font-display text-2xl text-white">
                      {item.name}
                    </h3>
                    {item.meta && (
                      <p className="mt-1 text-white/60 text-xs">{item.meta}</p>
                    )}
                  </div>
                </Link>
              ))}
            </div>
          </div>
        )}
      </div>
    </section>
  );
}
```

### `registry/default/sections/location-1/data.ts`

```ts
import type { LocationContent } from "../_types/location";

export const defaultLocation1Content: LocationContent = {
  action: {
    href: "/neighbourhoods",
    label: "All neighbourhood guides",
  },
  eyebrow: "Where we work",
  items: [
    {
      description:
        "Warehouse conversions, moored yachts, and the best morning light in the city.",
      href: "/neighbourhoods/harbour-district",
      image: {
        alt: "Harbour District",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786951154/templates/estate/marbrook/cndn_marbrook009.jpg",
      },
      label: "48 listings",
      meta: "Median $2.4M · +6.2% year on year",
      name: "Harbour District",
    },
    {
      description: "Elevated lots, long views, mid-century architecture.",
      href: "/neighbourhoods/northgate-heights",
      image: {
        alt: "Northgate Heights",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786951154/templates/estate/marbrook/cndn_marbrook010.jpg",
      },
      label: "31 listings",
      meta: "Median $3.1M · +4.1% year on year",
      name: "Northgate Heights",
    },
    {
      description: "New towers, concierge buildings, walk-to-water living.",
      href: "/neighbourhoods/marina-bay",
      image: {
        alt: "Marina Bay",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786951154/templates/estate/marbrook/cndn_marbrook011.jpg",
      },
      label: "26 listings",
      meta: "Median $1.7M · +8.7% year on year",
      name: "Marina Bay",
    },
    {
      description: "Cobbled lanes, listed façades, courtyard gardens.",
      href: "/neighbourhoods/old-town",
      image: {
        alt: "Old Town",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786951154/templates/estate/marbrook/cndn_marbrook012.jpg",
      },
      label: "19 listings",
      meta: "Median $1.2M · +2.8% year on year",
      name: "Old Town",
    },
    {
      description: "Newly built family streets, good schools, deep gardens.",
      href: "/neighbourhoods/cedar-park",
      image: {
        alt: "Cedar Park",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786951154/templates/estate/marbrook/cndn_marbrook013.jpg",
      },
      label: "37 listings",
      meta: "Median $980k · +5.4% year on year",
      name: "Cedar Park",
    },
  ],
  title: "Explore by neighbourhood",
};
```

### `registry/default/sections/location-1/section-header.tsx`

```tsx
import type React from "react";

import { cn } from "@/lib/utils";

import type { Surface } from "../_types/common";

/** The small uppercase label that opens most headers. */
export const eyebrowClass =
  "inline-flex items-center gap-2 font-medium text-[0.6875rem] uppercase tracking-[0.22em]";

export const surfaceClass: Record<Surface, string> = {
  default: "bg-background text-foreground",
  muted: "bg-muted text-foreground",
  primary: "bg-primary text-primary-foreground",
  secondary: "bg-secondary text-secondary-foreground",
};

/**
 * Which band the header sits on. `photo` keeps literal white, because
 * `--primary-foreground` inverts in dark mode and would be unreadable over a
 * photograph.
 */
export type SectionTone = "light" | "photo" | "primary" | "secondary";

export function toneFor(surface: Surface): SectionTone {
  if (surface === "primary") return "primary";
  if (surface === "secondary") return "secondary";
  return "light";
}

const toneClasses: Record<
  SectionTone,
  { eyebrow: string; heading: string; lede: string; tick: string }
> = {
  light: {
    eyebrow: "text-muted-foreground/70",
    heading: "text-primary",
    lede: "text-muted-foreground",
    tick: "bg-secondary",
  },
  photo: {
    eyebrow: "text-white/50",
    heading: "text-white",
    lede: "text-white/65",
    tick: "bg-secondary",
  },
  primary: {
    eyebrow: "text-primary-foreground/40",
    heading: "text-primary-foreground",
    lede: "text-primary-foreground/60",
    tick: "bg-secondary",
  },
  secondary: {
    eyebrow: "text-secondary-foreground/50",
    heading: "text-secondary-foreground",
    lede: "text-secondary-foreground/70",
    tick: "bg-primary",
  },
};

export function SectionHeader({
  action,
  actionAt = "sm",
  className,
  description,
  eyebrow,
  size = "default",
  title,
  tone = "light",
}: {
  /** Rendered beside the heading block once `actionAt` is reached. */
  action?: React.ReactNode;
  /** A text link fits from `sm`; a row of filter tabs needs `lg`. */
  actionAt?: "lg" | "sm";
  className?: string;
  description?: React.ReactNode;
  eyebrow: string;
  /** `sm` is the narrow-sidebar size used by 4/8 splits. */
  size?: "default" | "sm";
  title: React.ReactNode;
  tone?: SectionTone;
}): React.ReactElement {
  const tones = toneClasses[tone];

  return (
    <div
      className={cn(
        action && "flex flex-col gap-6",
        action &&
          (actionAt === "lg"
            ? "gap-8 lg:flex-row lg:items-end lg:justify-between"
            : "sm:flex-row sm:items-end sm:justify-between"),
        className,
      )}
    >
      <div className={cn(action && "max-w-xl")}>
        <p className={cn(eyebrowClass, tones.eyebrow)}>
          <span className={cn("size-1", tones.tick)} />
          {eyebrow}
        </p>

        <h2
          className={cn(
            "mt-5 font-display",
            tones.heading,
            size === "sm"
              ? "text-3xl leading-[1.1] sm:text-4xl"
              : "text-4xl leading-[1.05] sm:text-5xl",
          )}
        >
          {title}
        </h2>

        {description && (
          <p className={cn("mt-4 max-w-xl leading-relaxed", tones.lede)}>
            {description}
          </p>
        )}
      </div>

      {action}
    </div>
  );
}
```

### `registry/default/sections/_types/common.ts`

```ts
/**
 * Shapes shared by every token-based section. Each section ships this file
 * alongside its own category types, so installing several sections simply
 * rewrites the same file.
 */

/** Which band a section sits on. A style choice, never part of `content`. */
export type Surface = "default" | "muted" | "primary" | "secondary";

export type ImageAsset = {
  alt: string;
  src: string;
};

export type LinkAction = {
  href: string;
  label: string;
};

/** Eyebrow + heading + optional lede, the header most sections open with. */
export type SectionIntro = {
  description?: string;
  eyebrow: string;
  title: string;
};

/** A figure that counts up when it scrolls into view. */
export type Stat = {
  decimals?: number;
  label: string;
  prefix?: string;
  suffix?: string;
  value: number;
};

/** A figure that is displayed as written ("1,240+", "4.9/5"). */
export type Highlight = {
  label: string;
  value: string;
};

export type FormField = {
  label: string;
  name: string;
  /** Only for `type: "select"`. The first option is the default. */
  options?: string[];
  placeholder?: string;
  required?: boolean;
  /** `full` spans both columns of a two-column form. */
  span?: "full" | "half";
  type?: "email" | "select" | "tel" | "text" | "textarea";
};

export type FormContent = {
  description?: string;
  fields: FormField[];
  note?: string;
  submitLabel: string;
  success: {
    description: string;
    resetLabel: string;
    title: string;
  };
  title: string;
};
```

### `registry/default/sections/_types/location.ts`

```ts
import type { ImageAsset, LinkAction, SectionIntro } from "./common";

export type LocationContent = SectionIntro & {
  action?: LinkAction;
  items: {
    description: string;
    href: string;
    image: ImageAsset;
    /** Small uppercase line above the name, e.g. "48 listings". */
    label: string;
    /** Supporting line under the name, e.g. "Median $2.4M". */
    meta?: string;
    name: string;
  }[];
};
```
