Calm motion: animations on this site only fade, with no movement
Related articles
Articles on the same topic, with an image and the reading time
Suggests what to read next, at the end of an article. For one list of headlines, use the news block.
Basic
Read next
vue
<template>
<BlessRelatedArticles :articles :level="3" />
</template>
<script setup lang="ts">
import { BlessRelatedArticles, type BlessRelatedArticle } from "blessing-ui";
import { art } from "./_data";
const articles: BlessRelatedArticle[] = [
{
id: "mic",
title: "How to pick your first microphone",
href: "#mic",
topic: "Gear",
minutes: 7,
image: art("🎙️", "f3e1e7"),
},
{
id: "gain",
title: "Set the gain once, and never clip again",
href: "#gain",
topic: "Recording",
minutes: 4,
image: art("🎚️", "dfe8f3"),
},
{
id: "edit",
title: "Edit an hour of talk in twenty minutes",
href: "#edit",
topic: "Editing",
minutes: 9,
image: art("✂️", "e8f3df"),
},
];
</script>articlesis a list of articles. Each article has anid, atitle, and anhref. It can also have animage, atopic, andminutesto read.- The block is a section with a heading, "Read next".
levelsets the level of that heading (default 2). - Each card has one link, the title. A click anywhere on the card follows it, and the focus ring goes around the whole card. So a keyboard user meets one stop for each card.
- The images are decoration, so they have no text.
- Change the words with
labelsor a label pack:titleandread(a function).
Usage
ts
import { BlessRelatedArticles } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
articles* | BlessRelatedArticle[] | — | |
level | 2 | 3 | 4 | 2 | the heading level of the title of the block |
labels | Partial<{ title: string; read: (minutes: number) => string; }> | — |