twitter-components
v0.2.1
Published
Composable Twitter web components with typed data, slots, and server rendering.
Downloads
533
Maintainers
Readme
Twitter Components
Add Twitter posts to your site using your own data.

Install
bun add twitter-componentsAlso works with npm, pnpm, and Yarn.
Use
<twitter-post id="post" theme="dark"></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: { likes: 12480, views: 84947 },
};Use .options for themes, counts, dates, media, and actions. Replace individual regions with slots. Render HTML on the server with renderTwitterPost or renderTwitterTimeline from twitter-components/server.
Develop
bun install
bun run check
bun run docs:dev
bun run buildThe same scripts work with npm, pnpm, and Yarn. Run docs:build for the static docs.
Notes
This project is licensed under the MIT license. See NOTICE.md for design references used.
Skyra-project's discord-components was a big inspiration for me to create this project.
