Skip to content

Components

The Starlight Blog plugin provides components that you can use to display blog content in your project.

The <Preview> component renders a blog post using the same preview available on blog listing pages.

import Preview from 'starlight-blog/ui/Preview.astro'

Render a post from blog data by passing it to the <Preview> component.

RecentPostPreview.astro
---
import Preview from 'starlight-blog/ui/Preview.astro'
const post = Astro.locals.starlightBlog.posts.at(0)
---
{post && <Preview {post} />}
Preview

Vario nunc polo

Canes plura palmas eodem huc scelerate spectat

Section titled “Canes plura palmas eodem huc scelerate spectat”

Lorem markdownum, numen adducere Parthaoniae versa mirabere mea. Magnum utque, et senserat ferendum disiectisque sub coniunx et stolidi telum; duabus.

Crebri pantherarum talis sed etiamnum habet: modo transire. Cum Xanthos rura per iter erat tunc insanos tibi ignorant cum inde fulgebant, dicentem certamina temptabat iam inpleratque. Enim figuram aliter, semper curru mihi est.

const promOptical = disk_extension_zero()

The <Preview> component accepts the following props:

Required
Type: StarlightBlogPostData

The blog post to render. Use blog data to get a list of posts.