List component
Create organized lists and content catalogs by automatically listing files in a specified directory.
Use a list block instead: it works in plain Markdown, renders on the server and resolves authors. The table in Coming from the List component translates every prop.
Using the List component requires MDX rendering, since it uses JSX (like <List />).
Make sure to switch to MDX rendering for this page by changing its extension to .mdx (if you're using "auto" syntax mode) or by adding syntaxMode: mdx in the frontmatter.
π Read more about different syntax rendering modes and how to enable them: https://flowershow.app/blog/announcing-syntax-mode-configuration
Basic example
<List dir="/blog"/>
The List component will display all the markdown files in the specified directory. By default, it shows the title as the headline and the description as the summary.
Properties
The List component accepts the following props:
-
dir (optional) Directory (relative to site root) to list items from.
Default:""(root folder)
Type:string -
slots (optional) Lets you decide what information should appear in each part of the list item.
Available slots:
- media β usually an image
- eyebrow β small text shown above the title (for example, a date)
- headline β the main title
- summary β a short description
- footnote β small text shown below (for example, authors)
Each slot can be connected to a field from your pageβs frontmatter (like
title,description,date,authors,image).Default:
{ headline: "title", summary: "description" } -
pageSize (optional)
Number of items per page for pagination. If not provided, all items are shown without pagination. Type:number
Example:
<List
dir="/blog"
slots={{
headline: "title",
summary: "description",
eyebrow: "date",
footnote: "authors",
media: "image"
}}
pageSize={5}
/>
π Check it out in our interactive documentation: https://components.flowershow.app/?path=/docs/other-listβdocs
Behavior
The List component:
- Ignores
README.mdandindex.mdfiles - Is recursive (includes files in subdirectories)
- Sorts by date if available, otherwise by title
Styling
The List component renders stable CSS classes you can target from custom.css or a theme:
| Class | Element |
|---|---|
.list-component | The whole list |
.list-component-item | One card |
.list-component-item-media | The image area (media slot) |
.list-component-item-media-link | The link around the image |
.list-component-item-content | The text column |
.list-component-item-eyebrow | The eyebrow slot |
.list-component-item-headline | The headline slot (an h3) |
.list-component-item-headline-link | The link inside the headline |
.list-component-item-summary | The summary slot |
.list-component-item-footnote | The footnote slot |
.list-component-pagination | Page controls (when pageSize is set) |
.list-component-empty | The "No items found" message |
.list-component-error | The message shown when items fail to load |
For example, to make the whole card clickable rather than only the headline:
.list-component-item-headline-link::after {
content: "";
position: absolute;
inset: 0;
}
This works because each .list-component-item is already position: relative. The overlay sits above everything else in the card, so any other links in it (for example in the summary or footnote) stop being clickable. Lift them above the overlay:
.list-component-item a:not(.list-component-item-headline-link) {
position: relative;
z-index: 1;
}
The full list, including loading skeleton and pagination classes, is in the theme class reference.
For a detailed guide including examples and step-by-step instructions, see the content catalogs guide.