# Property 1

> Grid of property cards with optional filter tabs and a view-all footer (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/property-1).

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

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet-blocks/property-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/badge`, `@cnippet/button`, `@cnippet/empty`, `@cnippet/tabs`, `@cnippet/toggle`, `@cnippet/tooltip`, `@cnippet/utils`

## Files

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

```tsx
"use client";

import { ArrowUpRight } from "lucide-react";
import Link from "next/link";
import { useState } from "react";

import { Button } from "@/components/ui/button";
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyTitle,
} from "@/components/ui/empty";
import { Tabs, TabsList, TabsTab } from "@/components/ui/tabs";
import { cn } from "@/lib/utils";

import type { Surface } from "../_types/common";
import type { PropertyGridContent } from "../_types/property";
import { defaultProperty1Content } from "./data";
import { PropertyCard } from "./property-card";
import { SectionHeader, surfaceClass, toneFor } from "./section-header";

/** A three-across grid of property cards, with optional filter tabs and a
 *  "view all" footer. Without tabs it doubles as "similar homes". */
export default function Property1({
  content = defaultProperty1Content,
  surface = "muted",
}: {
  content?: PropertyGridContent;
  surface?: Surface;
}) {
  const [filter, setFilter] = useState(content.filters?.[0]?.value ?? "all");

  const visible =
    filter === "all"
      ? content.properties
      : content.properties.filter((property) => property.category === filter);

  const tabs = content.filters && content.filters.length > 0 && (
    <Tabs onValueChange={(value) => setFilter(String(value))} value={filter}>
      <TabsList
        className="w-full gap-0 border border-border bg-background p-0 sm:w-fit"
        variant="default"
      >
        {content.filters.map((item) => (
          <TabsTab
            className="h-11 px-4 text-muted-foreground text-sm data-active:text-primary sm:h-11 sm:text-sm"
            key={item.value}
            value={item.value}
          >
            {item.label}
          </TabsTab>
        ))}
      </TabsList>
    </Tabs>
  );

  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={
            tabs ||
            (content.action && !content.summary && (
              <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>
            ))
          }
          actionAt={tabs ? "lg" : "sm"}
          className="border-border border-b pb-8"
          description={content.description}
          eyebrow={content.eyebrow}
          title={content.title}
          tone={toneFor(surface)}
        />

        {visible.length > 0 ? (
          <div className="mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
            {visible.map((property, index) => (
              <PropertyCard
                key={property.href}
                priority={index < 3}
                property={property}
              />
            ))}
          </div>
        ) : (
          <Empty className="mt-10 rounded-lg border border-border border-dashed bg-card py-16">
            <EmptyTitle className="font-display font-normal text-2xl text-primary">
              {content.empty.title}
            </EmptyTitle>
            <EmptyDescription>{content.empty.description}</EmptyDescription>
            {content.empty.actions && content.empty.actions.length > 0 && (
              <EmptyContent className="mt-6 flex flex-row flex-wrap justify-center gap-3">
                {content.empty.actions.map((action) => (
                  <Button
                    className="border-none bg-primary px-7 text-primary-foreground shadow-none hover:bg-primary/90"
                    key={action.href}
                    render={<Link href={action.href} />}
                    size="xl"
                  >
                    {action.label}
                  </Button>
                ))}
              </EmptyContent>
            )}
          </Empty>
        )}

        {content.summary && content.action && (
          <div className="mt-12 flex flex-wrap items-center justify-between gap-6 border-border border-t pt-8">
            <p className="text-muted-foreground text-sm">
              {content.summary
                .replace("{visible}", String(visible.length))
                .replace("{total}", String(content.properties.length))}
            </p>
            <Button
              className="group gap-2 border-none bg-primary px-7 text-primary-foreground shadow-none hover:bg-primary/90"
              render={<Link href={content.action.href} />}
              size="xl"
            >
              {content.action.label}
              <ArrowUpRight className="size-4 transition-transform duration-300 group-hover:translate-x-0.5 group-hover:-translate-y-0.5" />
            </Button>
          </div>
        )}
      </div>
    </section>
  );
}
```

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

```ts
import type { PropertyGridContent } from "../_types/property";

export const defaultProperty1Content: PropertyGridContent = {
  action: {
    href: "/properties",
    label: "View all properties",
  },
  description:
    "Every listing is visited, measured, and photographed by our own team before it reaches this page.",
  empty: {
    description: "Register your search and we'll call you first.",
    title: "No homes in this category",
  },
  eyebrow: "Featured listings",
  filters: [
    {
      label: "All homes",
      value: "all",
    },
    {
      label: "For sale",
      value: "sale",
    },
    {
      label: "For rent",
      value: "rent",
    },
    {
      label: "New developments",
      value: "new",
    },
  ],
  properties: [
    {
      address: "24 Rowan Street, Harbour District",
      area: 4280,
      areaUnit: "ft²",
      baths: 4,
      beds: 5,
      category: "sale",
      district: "harbour-district",
      href: "/properties/blackwood-house",
      image: {
        alt: "Blackwood House",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook002.jpg",
      },
      price: "$4,250,000",
      status: "For sale",
      title: "Blackwood House",
      type: "Architectural home",
      year: 1893,
    },
    {
      address: "9 Vantage Lane, Northgate Heights",
      area: 3110,
      areaUnit: "ft²",
      baths: 3,
      beds: 4,
      category: "sale",
      district: "northgate-heights",
      href: "/properties/the-coastline-villa",
      image: {
        alt: "The Coastline Villa",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook003.jpg",
      },
      price: "$3,180,000",
      status: "For sale",
      title: "The Coastline Villa",
      type: "Sea-facing villa",
      year: 1961,
    },
    {
      address: "141 Alder Row, Old Town",
      area: 2650,
      areaUnit: "ft²",
      baths: 3,
      beds: 4,
      category: "rent",
      district: "old-town",
      href: "/properties/alder-row-cottage",
      image: {
        alt: "Alder Row Cottage",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook004.jpg",
      },
      price: "$9,400 / mo",
      status: "For rent",
      title: "Alder Row Cottage",
      type: "Heritage cottage",
      year: 1824,
    },
    {
      address: "3 Marina Bay Terrace, Marina Bay",
      area: 5120,
      areaUnit: "ft²",
      baths: 5,
      beds: 6,
      category: "new",
      district: "marina-bay",
      href: "/properties/marina-bay-residences",
      image: {
        alt: "Marina Bay Residences",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook005.jpg",
      },
      price: "From $5,900,000",
      status: "New development",
      title: "Marina Bay Residences",
      type: "Six new-build homes",
      year: 2026,
    },
    {
      address: "58 Cedar Park Drive, Cedar Park",
      area: 3640,
      areaUnit: "ft²",
      baths: 4,
      beds: 5,
      category: "sale",
      district: "cedar-park",
      href: "/properties/cedar-park-lodge",
      image: {
        alt: "Cedar Park Lodge",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook006.jpg",
      },
      price: "$2,740,000",
      status: "For sale",
      title: "Cedar Park Lodge",
      type: "Family lodge",
      year: 2011,
    },
    {
      address: "72 Riverside Crescent, Riverside Quarter",
      area: 2980,
      areaUnit: "ft²",
      baths: 3,
      beds: 4,
      category: "rent",
      district: "riverside-quarter",
      href: "/properties/riverside-colonial",
      image: {
        alt: "Riverside Colonial",
        src: "https://res.cloudinary.com/qgiongel/image/upload/q_auto/f_auto/v1786950553/templates/estate/marbrook/cndn_marbrook007.jpg",
      },
      price: "$11,200 / mo",
      status: "For rent",
      title: "Riverside Colonial",
      type: "Pool residence",
      year: 1908,
    },
  ],
  summary: "Showing {visible} of {total} featured listings",
  title: "Homes currently on our books",
};
```

### `registry/default/sections/property-1/property-card.tsx`

```tsx
"use client";

import { Bath, BedDouble, Heart, MapPin, Maximize } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import type React from "react";
import { useState } from "react";

import { Badge } from "@/components/ui/badge";
import { Toggle } from "@/components/ui/toggle";
import { Tooltip, TooltipPopup, TooltipTrigger } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";

import type { Property } from "../_types/property";

export function PropertyCard({
  priority = false,
  property,
  sizes = "(min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw",
}: {
  priority?: boolean;
  property: Property;
  sizes?: string;
}): React.ReactElement {
  const [saved, setSaved] = useState(false);

  return (
    <article className="group flex flex-col overflow-hidden rounded-lg border border-border bg-card transition-colors hover:border-input">
      <div className="relative aspect-4/3 overflow-hidden">
        <Image
          alt={property.image.alt}
          className="object-cover transition-transform duration-700 ease-out group-hover:scale-105"
          fill
          priority={priority}
          sizes={sizes}
          src={property.image.src}
        />
        <div className="pointer-events-none absolute inset-x-0 bottom-0 h-28 bg-linear-to-t from-primary/70 to-transparent" />

        <Badge className="absolute top-4 left-4 bg-white/95 px-3 py-1 font-medium text-primary text-xs uppercase tracking-[0.14em]">
          {property.status}
        </Badge>

        <Tooltip>
          <TooltipTrigger
            render={
              <Toggle
                aria-label={
                  saved
                    ? `Remove ${property.title} from saved`
                    : `Save ${property.title}`
                }
                className="absolute top-4 right-4 size-9 min-w-0 border-none bg-white/95 px-0 text-primary shadow-none hover:bg-white data-pressed:bg-white"
                onPressedChange={setSaved}
                pressed={saved}
              >
                <Heart
                  className={cn(
                    "size-4 transition-colors",
                    saved && "fill-primary text-primary",
                  )}
                />
              </Toggle>
            }
          />
          <TooltipPopup>
            {saved ? "Remove from saved" : "Save property"}
          </TooltipPopup>
        </Tooltip>

        <p className="absolute bottom-4 left-4 font-display text-2xl text-white">
          {property.price}
        </p>
      </div>

      <div className="flex flex-1 flex-col p-6">
        <p className="inline-flex items-center gap-2 font-medium text-[0.6875rem] text-muted-foreground/70 uppercase tracking-[0.22em]">
          {property.type}
        </p>

        <h3 className="mt-3 font-display text-2xl text-primary">
          {/* Deliberately not a stretched link: the image carries the save
              toggle, which a full-card overlay would swallow. */}
          <Link
            className="transition-colors hover:text-primary/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
            href={property.href}
          >
            {property.title}
          </Link>
        </h3>

        <p className="mt-2 flex items-start gap-1.5 text-muted-foreground text-sm">
          <MapPin className="mt-0.5 size-3.5 shrink-0" />
          {property.address}
        </p>

        <dl className="mt-6 grid grid-cols-3 gap-2 border-border border-t pt-5 text-muted-foreground text-sm">
          <div className="flex items-center gap-2">
            <BedDouble className="size-4 text-muted-foreground/70" />
            <dt className="sr-only">Bedrooms</dt>
            <dd>{property.beds} bd</dd>
          </div>
          <div className="flex items-center gap-2">
            <Bath className="size-4 text-muted-foreground/70" />
            <dt className="sr-only">Bathrooms</dt>
            <dd>{property.baths} ba</dd>
          </div>
          <div className="flex items-center gap-2">
            <Maximize className="size-4 text-muted-foreground/70" />
            <dt className="sr-only">Floor area</dt>
            <dd>
              {property.area.toLocaleString("en-US")}{" "}
              {property.areaUnit ?? "ft²"}
            </dd>
          </div>
        </dl>
      </div>
    </article>
  );
}
```

### `registry/default/sections/property-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/property.ts`

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

export type Property = {
  address: string;
  area: number;
  areaUnit?: string;
  baths: number;
  beds: number;
  /** Matches a filter `value`, e.g. "sale" | "rent" | "new". */
  category: string;
  /** Matches a `districts` option value on the listing section. */
  district?: string;
  href: string;
  image: ImageAsset;
  price: string;
  status: string;
  title: string;
  type: string;
  year?: number;
};

export type PropertyFilter = { label: string; value: string };

export type PropertyEmptyState = {
  actions?: LinkAction[];
  description: string;
  title: string;
};

/** A grid of property cards, optionally filtered by tabs. */
export type PropertyGridContent = SectionIntro & {
  action?: LinkAction;
  empty: PropertyEmptyState;
  /** The first filter should be the "all" option, with value "all". */
  filters?: PropertyFilter[];
  properties: Property[];
  /** Footer line; `{visible}` and `{total}` are replaced. */
  summary?: string;
};

/** The full book: status tabs, district filter, sort and pagination. */
export type PropertyListingContent = SectionIntro & {
  districts: PropertyFilter[];
  /** Label for "any district" (value "all"). */
  districtsAll: string;
  empty: PropertyEmptyState;
  perPage: number;
  properties: Property[];
  /** Label of the button that clears every filter. */
  resetLabel: string;
  sorts: PropertyFilter[];
  statuses: PropertyFilter[];
};

export type PropertyDetailContent = {
  agent?: {
    bio: string;
    email: string;
    image: ImageAsset;
    label: string;
    name: string;
    phone: string;
    role: string;
  };
  description: string[];
  eyebrow: string;
  facts: { label: string; value: string }[];
  features: string[];
  featuresTitle: string;
  location?: {
    description: string;
    href: string;
    label: string;
    meta: string;
    name: string;
  };
  title: string;
};
```
