Skip to main content

GridTitle

Renders the main heading for product grid pages -- category listings, search results, brand pages, or any context where a prominent title is needed above a product grid.

Usage

Basic category page

import GridTitle from "@/components/propeller/GridTitle";

<GridTitle title="Outdoor & Travel" language="NL" />

Dynamic category name from the SDK

<GridTitle
title={category.name[0]?.value ?? "Products"}
language={process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || "NL"}
/>

Search results page

<GridTitle title={`Search results for "${searchTerm}"`} language="NL" />

As an h2 (page already has an h1)

Use headingLevel="h2" when the grid is embedded inside a page that already owns the h1, such as a brand landing page or a CMS page with its own title.

<GridTitle title="Related products" language="NL" headingLevel="h2" />

With extra styling

<GridTitle
title="Brand: Fellowes"
language="NL"
className="border-b pb-4"
/>

Combined with other grid components

<div>
<GridTitle title={categoryName} language="NL" />
<CategoryDescription description={categoryDescription} language="NL" />
<GridToolbar ... />
<ProductGrid ... />
<GridPagination ... />
</div>

Configuration

Content

PropTypeRequiredDefaultDescription
titlestringYes--The heading text. Typically a category name, search term, or brand name.
languagestringYes--Language code for the content (e.g. 'NL', 'EN').

Appearance

PropTypeRequiredDefaultDescription
headingLevelstringNo'h1'HTML heading level. Set to 'h2' when the page already has its own h1.
classNamestringNo--Additional CSS class(es) applied to the root <div> wrapper.

Behavior

  • Renders an <h1> tag by default. When headingLevel is set to 'h2', it renders an <h2> instead. All other headingLevel values fall through to the h1 default.
  • The heading uses responsive font sizing: text-3xl on small screens, text-4xl on sm: breakpoint and above, with font-bold and tracking-tight.
  • The root element applies mb-8 bottom margin for spacing above the next grid section.
  • Fully stateless -- no internal state, no side effects, no API calls. It re-renders only when props change.

SDK Services

GridTitle is a presentational component -- it does not call any SDK service directly. The parent page is responsible for fetching category data and passing the title string.

When used on a category page, the title typically comes from a Category object returned by CategoryService.getCategory(). The relevant field is:

Category fieldTypeUsage
nameLocalizedString[] (array)category.name[0]?.value provides the title.

For search pages, the title is constructed from the user's search query string rather than an SDK field.