Twitter Components
Add Twitter posts to your site using your own data.
Install
Section titled “Install”bun add twitter-componentsnpm install twitter-componentspnpm add twitter-componentsyarn add twitter-componentsStart with a post
Section titled “Start with a post”<twitter-post id="post" theme="dark" count-format="compact"></twitter-post>import "twitter-components/register";
const post = document.querySelector("twitter-post");post.data = { author: "John Doe", handle: "john_doe", url: "https://x.com/john_doe/status/1", timestamp: "2026-09-13T12:30:00Z", content: "would you look at that! i can make fake tweets", stats: { replies: 12, reposts: 72, quotes: 18, likes: 12480, views: 84947 },};Use .post as an alias for .data. A timeline uses .thread or .data with { label, posts }.
Try the playground, read the composition guide, or inspect the settings.