Related content


Install
npx shadcn add @klarhimmel/related-contentDetailsAbout, usage, props and more
A shared grid of linked cards for other articles, projects, services, products or events. Images are optional.
Import
Import
- content/related
- Category
- Long-form text and timelines for about and policy pages. New project? Set it up once: /get-started/installation.
Notes
When to use it
A reusable group of other projects, articles, services, products or events shown after the main content. Use it to offer a few relevant destinations without repeating the item the visitor has just read.
Writing for it
- Give the section a specific title such as Other projects or More guides. Each card needs a destination and a title; keep its summary to one short sentence. Images are optional: omit media for a text-only event card, or supply an image with a useful description. - Choose between one and six related items and filter out the current page before passing the list. The whole card is one link, so its contents should not contain additional actions.
Watch out for
This block displays the list supplied by the page. It does not rank recommendations or load content. Check that every destination resolves and that a small set of items remains useful on a phone.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Name the next step' | Text, up to 120 characters. |
description | string | 'Say in one line what these lead to.' | Text, up to 300 characters. |
items | { title, description, href, media }[] | 2 items | List of 1 to 6. Each item: title, description, href, media (optional). |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |