# Blog grid

A responsive editorial article grid with native dates and destinations plus optional controlled search and categories.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a responsive editorial article grid with native dates and destinations plus optional controlled search and categories.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than blog grid.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Blog grid

```sh
npx shadcn@latest add @tidal-pro/blog-grid
```

Stylesheets: `components/ui/tidal.css`, `components/ui/blog-grid.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/blog-grid.css";
import{TidalBlogGrid}from"./components/ui/blog-grid";
export default()=><div className="tidal-scope"><TidalBlogGrid articles={[{id:"example",title:"Demo",category:"value",date:{label:"Demo",dateTime:"2026-01-01"},href:"#"}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalBlogGrid.articles: ReadonlyArray<TidalBlogArticle>`: Required articles value accepted by this exported component.
- `TidalBlogGrid.title: ReactNode`: Required title value accepted by this exported component.
- `TidalBlogGrid.articleHeadingLevel?: "h3" | "h4" | "h5" | undefined`: Optional article heading level value accepted by this exported component.
- `TidalBlogGrid.articlesLabel?: string | undefined` (default "Articles"): Optional articles label value accepted by this exported component.
- `TidalBlogGrid.category?: TidalBlogCategoryControl | undefined`: Optional category value accepted by this exported component.
- `TidalBlogGrid.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalBlogGrid.emptyMessage?: ReactNode` (default "No articles match this view."): Optional empty message value accepted by this exported component.
- `TidalBlogGrid.eyebrow?: ReactNode` (default "Blog grid"): Optional eyebrow value accepted by this exported component.
- `TidalBlogGrid.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalBlogGrid.headingLevel?: "h2" | "h3" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalBlogGrid.readLabel?: ((article: TidalBlogArticle) => string) | undefined` (default (article) => `Read ${article.title}`): Optional read label value accepted by this exported component.
- `TidalBlogGrid.search?: TidalBlogSearchControl | undefined`: Optional search value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/blog-grid.tsx) | [Manifest](https://tidalui.com/examples/blog-grid.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useLayoutEffect, useMemo, useRef, useState } from "react";

import { RotateCcw } from "lucide-react";

import { TidalBlogGrid, type TidalBlogArticle } from "./components/ui/blog-grid";

import "./components/ui/blog-grid.css";

function tidalExampleAvatarDataUri(seed: unknown) {
  const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI";
  const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"];
  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect width="96" height="96" rx="48" fill="${color}"/><circle cx="48" cy="38" r="17" fill="white" fill-opacity=".92"/><path d="M18 92c3-22 15-34 30-34s27 12 30 34" fill="white" fill-opacity=".92"/></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

function tidalExampleImageDataUri(label: string) {
  const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image";
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 675"><defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop stop-color="#171717"/><stop offset="1" stop-color="#555555"/></linearGradient></defs><rect width="1200" height="675" fill="url(#g)"/><circle cx="950" cy="100" r="260" fill="white" fill-opacity=".08"/><text x="80" y="570" fill="white" font-family="system-ui,sans-serif" font-size="64" font-weight="700">${safeLabel}</text></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

const tidalExampleStyles = ".tidal-scope .blog-grid-demo {\n  display: grid;\n  width: min(100%, 1040px);\n  min-width: 0;\n  gap: 18px;\n  margin-inline: auto;\n}\n\n.tidal-scope .blog-grid-demo-empty {\n  display: grid;\n  gap: 12px;\n  justify-items: center;\n}\n\n.tidal-scope .blog-grid-demo-empty strong {\n  color: var(--t-ink);\n}\n\n.tidal-scope .blog-grid-demo-empty button {\n  display: inline-flex;\n  min-width: 44px;\n  min-height: 44px;\n  align-items: center;\n  justify-content: center;\n  gap: 7px;\n  padding: 8px 12px;\n  color: var(--t-surface);\n  background: var(--t-ink);\n  border: 1px solid var(--t-ink);\n  border-radius: var(--t-radius-control);\n  font: inherit;\n  font-size: 11px;\n  cursor: pointer;\n}\n\n.tidal-scope .blog-grid-demo-detail {\n  min-width: 0;\n  padding: 22px;\n  color: var(--t-surface);\n  background: var(--t-ink);\n  border-radius: var(--t-radius-card);\n  scroll-margin-block: 18px;\n}\n\n.tidal-scope .blog-grid-demo-detail:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .blog-grid-demo-detail > span {\n  color: color-mix(in srgb, var(--t-surface) 68%, transparent);\n  font-size: 11px;\n  font-weight: 760;\n  letter-spacing: 0.13em;\n  text-transform: uppercase;\n}\n\n.tidal-scope .blog-grid-demo-detail h3 {\n  margin: 8px 0 0;\n  overflow-wrap: anywhere;\n  font-size: 24px;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.tidal-scope .blog-grid-demo-detail p {\n  max-width: 72ch;\n  margin: 11px 0 0;\n  color: color-mix(in srgb, var(--t-surface) 74%, transparent);\n  font-size: 11px;\n  line-height: 1.6;\n  overflow-wrap: anywhere;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .blog-grid-demo-empty button:active {\n    transform: none;\n  }\n}";

type CategoryId = "all" | "design" | "engineering" | "workflow";

interface SampleArticle extends Omit<TidalBlogArticle, "href"> {
  categoryId: Exclude<CategoryId, "all">;
  body: string;
}

const ARTICLES: readonly SampleArticle[] = [
  {
    id: "reviewing-motion",
    title: "Reviewing motion without losing the interface",
    categoryId: "design",
    category: "Design",
    date: { label: "Oct 14, 2026", dateTime: "2026-10-14" },
    excerpt:
      "A product note about checking continuity, focus, and reduced motion together.",
    featured: true,
    cover: <CoverArt variant={0} />,
    author: {
      name: "Ava Stone",
      role: "Fictional editor",
      avatar: { src: tidalExampleAvatarDataUri("01") },
    },
    meta: "5 min read",
    body: "Review motion alongside focus order and reduced-motion behavior so transitions support the interface instead of obscuring it.",
  },
  {
    id: "native-controls",
    title: "Why native controls still carry the hard parts",
    categoryId: "engineering",
    category: "Engineering",
    date: { label: "Oct 11, 2026", dateTime: "2026-10-11" },
    excerpt:
      "A short note on forms, keyboard behavior, and application-owned state.",
    cover: <CoverArt variant={1} />,
    author: {
      name: "Noah Park",
      role: "Fictional engineer",
      avatar: { src: tidalExampleAvatarDataUri("02") },
    },
    meta: "4 min read",
    body: "Native controls preserve familiar keyboard, form, and browser behavior while leaving application outcomes to the product.",
  },
  {
    id: "small-screen",
    title: "A small-screen review is a product review",
    categoryId: "workflow",
    category: "Workflow",
    date: { label: "Oct 8, 2026", dateTime: "2026-10-08" },
    excerpt:
      "Field notes for evaluating real controls before decorative polish.",
    cover: <CoverArt variant={2} />,
    author: {
      name: "Mila Santos",
      role: "Fictional reviewer",
      avatar: { src: tidalExampleAvatarDataUri("03") },
    },
    meta: "3 min read",
    body: "Small-screen review reveals crowded controls, unstable focus, and hidden overflow before decorative polish makes them harder to isolate.",
  },
  {
    id: "honest-demos",
    title: "Building demos that explain their boundary",
    categoryId: "workflow",
    category: "Workflow",
    date: { label: "Oct 4, 2026", dateTime: "2026-10-04" },
    excerpt:
      "An editorial note about local state, clear labels, and explicit outcomes.",
    cover: <CoverArt variant={3} />,
    author: {
      name: "Eli Brooks",
      role: "Fictional writer",
      avatar: { src: tidalExampleAvatarDataUri("04") },
    },
    meta: "6 min read",
    body: "A useful demo labels its boundary once, then lets real controls and visible local outcomes explain the interaction.",
  },
  {
    id: "tokens",
    title: "Keeping a neutral token system expressive",
    categoryId: "design",
    category: "Design",
    date: { label: "Sep 29, 2026", dateTime: "2026-09-29" },
    excerpt:
      "A design note on rhythm, contrast, surfaces, and controlled variation.",
    cover: <CoverArt variant={4} />,
    meta: "4 min read",
    body: "A neutral token system can stay expressive through spacing, hierarchy, contrast, and a small set of deliberate surface changes.",
  },
];

export function BlogGridDemo() {
  const generatedId = useId().replace(/:/g, "");
  const [query, setQuery] = useState("");
  const [category, setCategory] = useState<CategoryId>("all");
  const [activeId, setActiveId] = useState<string | null>(null);
  const searchRef = useRef<HTMLInputElement>(null);
  const resetFocusPending = useRef(false);
  const normalized = query.trim().toLocaleLowerCase();
  const visible = useMemo(
    () =>
      ARTICLES.filter(
        (article) =>
          (category === "all" || article.categoryId === category) &&
          (!normalized ||
            `${article.title} ${article.categoryId} ${String(article.excerpt)}`
              .toLocaleLowerCase()
              .includes(normalized)),
      ),
    [category, normalized],
  );
  const counts = useMemo(
    () =>
      new Map(
        (["all", "design", "engineering", "workflow"] as CategoryId[]).map(
          (id) => [
            id,
            ARTICLES.filter(
              (article) =>
                (id === "all" || article.categoryId === id) &&
                (!normalized ||
                  `${article.title} ${article.categoryId} ${String(article.excerpt)}`
                    .toLocaleLowerCase()
                    .includes(normalized)),
            ).length,
          ],
        ),
      ),
    [normalized],
  );
  const active = ARTICLES.find((article) => article.id === activeId);
  const detailId = `blog-demo-${generatedId}-detail`;

  useLayoutEffect(() => {
    if (!resetFocusPending.current) return;
    resetFocusPending.current = false;
    searchRef.current?.focus({ preventScroll: true });
  }, [category, query]);

  const renderedArticles: readonly TidalBlogArticle[] = visible.map(
    (article) => ({
      ...article,
      href: `#${detailId}`,
      linkProps: { onClick: () => setActiveId(article.id) },
    }),
  );

  function reset() {
    resetFocusPending.current = true;
    setQuery("");
    setCategory("all");
    setActiveId(null);
  }

  return (
    <section className="blog-grid-demo" aria-label="Blog grid preview">
      <TidalBlogGrid
        title="Product notes"
        eyebrow={null}
        description="Search articles by title or topic."
        articles={renderedArticles}
        search={{
          value: query,
          label: "Search sample articles",
          placeholder: "Search title or topic",
          inputProps: { name: "article-query", autoComplete: "off" },
          inputRef: searchRef,
          onValueChange: setQuery,
        }}
        category={{
          value: category,
          label: "Filter sample articles",
          options: [
            { id: "all", label: "All", count: counts.get("all") },
            { id: "design", label: "Design", count: counts.get("design") },
            {
              id: "engineering",
              label: "Engineering",
              count: counts.get("engineering"),
            },
            {
              id: "workflow",
              label: "Workflow",
              count: counts.get("workflow"),
            },
          ],
          onValueChange: (id) => setCategory(id as CategoryId),
        }}
        emptyMessage={
          <div className="blog-grid-demo-empty">
            <strong>No local article matches</strong>
            <button type="button" onClick={reset}>
              <RotateCcw size={14} aria-hidden="true" /> Reset view
            </button>
          </div>
        }
        footer="Sample articles. Search and filters stay in this preview."
      />

      <div id={detailId}>
        {active ? (
          <article className="blog-grid-demo-detail" tabIndex={-1}>
            <span>Article detail</span>
            <h3>{active.title}</h3>
            <p>{active.body}</p>
          </article>
        ) : null}
      </div>
    </section>
  );
}

function CoverArt({ variant }: { variant: number }) {
  const offset = 22 + variant * 7;
  return (
    <svg viewBox="0 0 240 160" role="presentation">
      <rect
        x="28"
        y="25"
        width="184"
        height="110"
        rx="16"
        fill="var(--t-surface)"
        stroke="currentColor"
      />
      <path
        d={`M48 ${108 - variant * 3} C82 ${offset}, 126 ${132 - offset}, 191 ${47 + variant * 4}`}
        fill="none"
        stroke="currentColor"
        strokeWidth="5"
      />
      <circle
        cx={58 + variant * 15}
        cy={49 + variant * 5}
        r="10"
        fill="currentColor"
      />
      <path
        d="M48 118H192"
        stroke="currentColor"
        strokeWidth="2"
        strokeDasharray="4 7"
      />
    </svg>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <BlogGridDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title and consumer-owned articles are required. Each article has a stable id, string title, ReactNode category, native date label/dateTime, native href, and optional excerpt, decorative cover, featured state, meta, author, link/article native attributes and refs. Author avatars are decorative because the visible author name provides identity. Optional controlled search and category controls compose native handlers before higher callbacks; preventDefault suppresses the higher callback. Article headings remain semantic h3, h4 or h5 elements. A category control with no options renders no empty toolbar. Optional heading levels, eyebrow, description, articlesLabel, readLabel, emptyMessage, footer and native section attributes/ref remain consumer-owned. Filtering, routing, article content and destination behavior remain outside the component. It performs no request, publication, subscription, analytics, storage or persistence action.
