---
title: "Tweet"
description: "Shows a post the way it looks on X, as a feed row, an embed card, a post page, or a quote. Like, repost, and bookmark work, with no iframe."
url: https://gelatinui.com/components/tweet
markdown_url: https://gelatinui.com/components/tweet.md
access: free
install: "npx shadcn@latest add @gelatin-ui/tweet"
registry_item: https://gelatinui.com/r/tweet.json
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Tweet

> Shows a post the way it looks on X, as a feed row, an embed card, a post page, or a quote. Like, repost, and bookmark work, with no iframe.

Page: https://gelatinui.com/components/tweet

## When to use it

Best for: A post that must look like X, with real toggles and no iframe.

- Use `variant="embed"` for a post on another site, and `timeline` for a feed.
- Map your own data to `TweetPost` once, in your adapter.

## Notes for agents

- The item fetches nothing. Pass a `post`; with no children it renders the default parts of its variant.
- Set `viewerLiked`, `viewerReposted`, and `viewerBookmarked` from your data: the counts already hold them, so a refetch never counts a like twice.
- Give the post and the author a `url` for the time link, Copy link, Follow, and Read replies; only http and https addresses render.
- Pass `now` only in tests and screenshots: with it, the time text never updates.

## Anatomy

```text
Tweet
├─ TweetSocialLine (0..n)
├─ TweetAside (0..n)
├─ TweetThreadLine (0..n)
├─ TweetAvatar (0..n)
├─ TweetBody (0..n)
├─ TweetHeader (0..n)
├─ TweetNames (0..n)
├─ TweetAuthor (0..n)
├─ TweetHandle (0..n)
├─ TweetTime (0..n)
├─ TweetBrand (0..n)
├─ TweetMenu (0..n)
├─ TweetReplyingTo (0..n)
├─ TweetText (0..n)
├─ TweetEdited (0..n)
├─ TweetMedia (0..n)
├─ TweetPoll (0..n)
├─ TweetCard (0..n)
├─ TweetQuote (0..n)
├─ TweetNote (0..n)
├─ TweetDate (0..n)
├─ TweetActions (0..n)
├─ TweetReply (0..n)
├─ TweetRepost (0..n)
├─ TweetLike (0..n)
├─ TweetViews (0..n)
├─ TweetBookmark (0..n)
├─ TweetShare (0..n)
├─ TweetCopyLink (0..n)
├─ TweetReadReplies (0..n)
├─ TweetUnavailable (0..n)
└─ TweetSkeleton (0..n)
```

## API reference

### Tweet

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `post` | `TweetPost` |  | The post: author, text, counts, media, poll, card, quote, and note (`#/lib/tweet-model`). |
| `variant` | `TweetVariant` |  | `timeline` (default): a feed row. `embed`: a card for another site. `detail`: the post page. `quote`: the card inside another post. |
| `liked` | `boolean` |  |  |
| `defaultLiked` | `boolean` |  | Default: `post.viewerLiked`. The same for repost and bookmark. |
| `onLikedChange` | `function` |  |  |
| `reposted` | `boolean` |  |  |
| `defaultReposted` | `boolean` |  |  |
| `onRepostedChange` | `function` |  |  |
| `bookmarked` | `boolean` |  |  |
| `defaultBookmarked` | `boolean` |  |  |
| `onBookmarkedChange` | `function` |  |  |
| `readOnly` | `boolean` |  | Shows the counts with no toggles: no hover, no pointer, no press. |
| `locale` | `string` |  | The BCP 47 locale of counts and times. Default: the `DisplayLocaleProvider`, else "en-US". |
| `now` | `number` |  | A fixed now (epoch ms) for stories and tests. With it, the time text never updates. |
| `labels` | `Partial<TweetLabels>` |  |  |
| `children` | `ReactNode` |  | The parts. With none, the post renders the default parts of its `variant`. |

### TweetSocialLine

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `kind` | `"pin" \| "repost"` | "repost" | `repost` (default): "Ana reposted". `pin`: "Pinned". |

### TweetAside

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetThreadLine

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetAvatar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `inset` | `boolean` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |

### TweetBody

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetHeader

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetNames

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetAuthor

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetHandle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetTime

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetBrand

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"color" \| "mono"` |  | `color` draws the logo in its own colors; `mono` draws it in the text color when it has mono data. |

### TweetMenu

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `children` | `ReactNode` |  | The `MenuItem`s of the menu. The other props and the ref go to the trigger button. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### TweetReplyingTo

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetText

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `limit` | `number` |  | Fold a longer text at this many characters with Show more. Default: 280 in a feed, none on a post page or in an embed (they show the whole text, as x.com does). |

### TweetEdited

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetMedia

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `onOpen` | `function` |  | A press on a photo or a video (open a Lightbox or play). With none, the media is not a button. |

### TweetPoll

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number \| null` |  | The viewer's vote (a choice index). With one, the poll shows the results. |
| `defaultValue` | `number \| null` |  |  |
| `onValueChange` | `function` |  |  |

### TweetCard

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetQuote

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### TweetNote

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetDate

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetActions

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetReply

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### TweetRepost

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Toggle`: https://base-ui.com/react/components/toggle

### TweetLike

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Toggle`: https://base-ui.com/react/components/toggle

### TweetViews

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TweetBookmark

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Toggle`: https://base-ui.com/react/components/toggle

### TweetShare

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### TweetCopyLink

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### TweetReadReplies

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `external` | `boolean` |  | Opens the link in a new tab (`target="_blank"`, `rel="noopener noreferrer"`) and adds the arrow icon. A `target` or `rel` prop wins. |
| `tone` | `"destructive" \| "info" \| "neutral"` |  |  |
| `underline` | `"always" \| "dotted" \| "grow" \| "hover" \| "none"` |  |  |
| `variant` | `"default" \| "inherit" \| "muted"` |  |  |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### TweetUnavailable

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `labels` | `Partial<TweetLabels>` |  |  |
| `learnMoreHref` | `string` | "https://help.x.com/rules-and-policies/notices-on-x" | The Learn more address. Default: X's help page on unavailable posts. |

### TweetSkeleton

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Tweet | `tweet` |  |  |  |
| TweetSocialLine | `tweet-social-line` |  |  |  |
| TweetAside | `tweet-aside` |  |  |  |
| TweetThreadLine | `tweet-thread-line` |  |  |  |
| TweetAvatar | `tweet-avatar` |  |  |  |
| TweetBody | `tweet-body` | `data-card-open` |  |  |
| TweetHeader | `tweet-header` | `data-card-open` |  |  |
| TweetNames | `tweet-names` |  |  |  |
| TweetAuthor | `tweet-author` |  |  |  |
| TweetHandle | `tweet-handle` |  |  |  |
| TweetTime | `tweet-time` |  |  |  |
| TweetBrand | `tweet-brand` |  |  |  |
| TweetMenu | `tweet-menu` | `data-popup-open` |  |  |
| TweetReplyingTo | `tweet-replying-to` |  |  |  |
| TweetText | `tweet-text` | `data-card-open` |  |  |
| TweetEdited | `tweet-edited` |  |  |  |
| TweetMedia | `tweet-media` |  |  |  |
| TweetPoll | `tweet-poll` |  |  |  |
| TweetCard | `tweet-card` |  |  |  |
| TweetQuote | `tweet-quote` |  |  |  |
| TweetNote | `tweet-note` |  |  |  |
| TweetDate | `tweet-date` |  |  |  |
| TweetActions | `tweet-actions` |  |  | `hit-area` |
| TweetReply | `tweet-reply` |  | `--tweet-tone` |  |
| TweetRepost | `tweet-repost` |  | `--tweet-tone` |  |
| TweetLike | `tweet-like` |  | `--tweet-tone` |  |
| TweetViews | `tweet-views` |  |  |  |
| TweetBookmark | `tweet-bookmark` |  | `--tweet-tone` |  |
| TweetShare | `tweet-share` |  | `--tweet-tone` |  |
| TweetCopyLink | `tweet-copy-link` |  | `--tweet-tone` |  |
| TweetReadReplies | `tweet-read-replies` |  |  | `hit-area` |
| TweetUnavailable | `tweet-unavailable` |  |  |  |
| TweetSkeleton | `tweet-skeleton` |  |  |  |

## Usage

Map your data to a `TweetPost` once. Then put only the parts that you want in the post, in your order.

```tsx title="launch-post.tsx"
import {
  Tweet,
  TweetActions,
  TweetAvatar,
  TweetBrand,
  TweetCopyLink,
  TweetDate,
  TweetHeader,
  TweetLike,
  TweetMedia,
  TweetNames,
  TweetReply,
  TweetText,
} from "@/components/social/tweet";
import type { TweetPost } from "@/lib/tweet-model";

const post: TweetPost = {
  id: "1850112233445566001",
  url: "https://x.com/milanovak/status/1850112233445566001",
  author: { id: "milanovak", name: "Mila Novak", handle: "milanovak", verified: "blue" },
  text: "Woke up above the clouds on the last day of the trip. #alps",
  createdAt: Date.parse("2026-10-22T07:12:00+02:00"),
  replyCount: 24,
  repostCount: 118,
  likeCount: 2412,
};

export function LaunchPost() {
  return (
    <Tweet post={post} variant="embed">
      <TweetHeader>
        <TweetAvatar />
        <TweetNames />
        <TweetBrand />
      </TweetHeader>
      <TweetText />
      <TweetMedia />
      <TweetDate />
      <TweetActions>
        <TweetLike />
        <TweetReply />
        <TweetCopyLink />
      </TweetActions>
    </Tweet>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/tweet
```

It adds 84 registry items: 80 files, 14388 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@unpic/core`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Anchor](https://gelatinui.com/components/anchor.md)
- [Avatar](https://gelatinui.com/components/avatar.md)
- [Button](https://gelatinui.com/components/button.md)
- [Image](https://gelatinui.com/components/image.md)
- [Menu](https://gelatinui.com/components/menu.md)
- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Skeleton](https://gelatinui.com/components/skeleton.md)
- [Toggle](https://gelatinui.com/components/toggle.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Avatar](https://gelatinui.com/components/avatar.md)
- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Image](https://gelatinui.com/components/image.md)
- [Toggle](https://gelatinui.com/components/toggle.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves through the links and the actions of the post. |
| Enter | Opens a link, or turns like, repost, or bookmark on or off. |
| Space | Turns like, repost, or bookmark on or off. |

## Accessibility

Each post is an `article` named "Post by" and the author name.

Like, repost, and bookmark are toggle buttons with `aria-pressed`; their names hold the count ("2,412 likes. Like").

Show more, Show, and a poll choice keep the focus in the post when they go away.

A quote card has one link, its time; the link covers the card, and the other links stay above it.

The counts that roll are hidden from screen readers: the button names hold them.

## Motion

| Part | Motion |
| --- | --- |
| Like | panel · the heart pops when it turns on |
| Counts | panel · a count rolls to its new value |
| Poll | reveal · the result bars grow from the start edge after a vote |
| Hover | hover · the circle behind an action icon tints in the action color |
| Press | press · the action icon shrinks a little while pressed |
