Skip to content

Twitter

The <ShowcaseTwitter> component can be used to showcase Twitter (also known as X) posts or tweets.

Import

import { ShowcaseTwitter } from 'starlight-showcases'

Usage

Specify a list of Twitter posts to display using the entries prop.

src/content/docs/showcase.mdx
import { ShowcaseTwitter } from 'starlight-showcases'
<ShowcaseTwitter
entries={[
'https://x.com/astrodotbuild/status/1791519480696168572',
'https://x.com/astrodotbuild/status/1726752143204393421',
]}
/>

The above code generates the following on the page:

The <ShowcaseTwitter> component uses Astro Embed to load a minimal version of Twitter’s widget with zero JavaScript and only static HTML content. To convert the widgets into interactive embeds, check out the Astro Embed “Loading Twitter’s JavaScript” guide.

Props

The <ShowcaseTwitter> component accepts the following props:

entries

required
type: string[]

The list of Twitter post URLs to display. See the Usage section for an example.