Snippet
Content item component used inside a collection to render backend content fields as a text-first preview. Lives only inside .collection. Provides a featured type preset, sm and lg size values controlling internal spacing, and composable image-position values for left/right placement of an optional media item.
Usage
When to use
- Text-heavy listings: news, articles, search results, publications
- Collections where the title, summary, and meta are the primary content and media is optional
- Featured-item treatments for the first result in a listing
When not to use
- Visual grids of primarily-image items - use a card item type instead
- Standalone outside a collection - snippets always live inside
.collection
Do
- Render inside a
.collectionwrapper - Provide meaningful
alttext on the media when present - Use the title link as the primary click target; the read-more link is supplementary
Don't
- Use snippet as a search-result-only component - it is a generic content preview
- Render snippets without the
.collectionwrapper - Crop or resize images outside the component tokens
API
Slots
| Slot | Required | Description |
|---|---|---|
media | - | HTML content for the media slot (image or video). |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Linked title text. |
url | string | - | Link URL for the title. |
summary | string | - | Preview text. |
supertitle | string | - | Small label rendered above the title. |
date | string | - | Human-readable publication date. |
date_iso | string | - | ISO 8601 date for the machine-readable datetime attribute. |
author | string | - | Author name. |
reading_time | string | - | Reading time estimate. |
link_label | string | Read more | Read-more link text. |
title_tag | Enum: strong, h2, h3, h4, h5, h6 | h3 | Tag used for the title element. |
tags | array | - | Array of tag objects with url and text fields. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.subtle | Emphasis | - | Lower emphasis; a muted, quieter weight. |
.neutral | Emphasis | Yes | Default emphasis; the standard weight at balanced contrast. |
.accent | Emphasis | - | Higher emphasis; a stronger, louder weight. |
.sm | Size | - | Small. |
.lg | Size | - | Large. |
.horizontal | Orientation | Yes | Children flow along the horizontal axis. |
.vertical | Orientation | - | Children flow along the vertical axis. |
.featured | Type | - | Editorial preset that enlarges media and title for prominent placement. |
.reverse | Layout | - | Reverses the media / text flex order. |
Examples
Default
Standard layout with all fields visible and media on the left.
Small
Dense layout for long listings - smaller image, fewer meta fields, tighter spacing.
Featured
Prominent layout for the hero result or first item in a list - larger image and title.
Image right
Media positioned on the right of the text content.
Text only
Snippet with no media - renders as a text-only item; the image-position class is ignored.
Featured image right
Composed .featured + .reverse value demonstrating that variants combine.
Accessibility
- WCAG 2.2 AA
- Title is itself a link (not a separate "read more" target) so keyboard and screen-reader users reach it first
- Appropriate heading level (default
<h3>, assuming the collection sits under an<h2>) - Tags render as
<ul>of real<a>elements - Media
altis meaningful when informative, empty when decorative - Date uses
<time datetime="..."> - Visible
:focus-visibleoutline on all interactive elements - Sufficient color contrast for small meta text
Dependencies
- collection - required wrapper (snippets are never standalone)