One post or reply from X, Threads or another network, kept word for word: who wrote it, what they wrote, when and where. The whole card opens the original in a new tab, long text folds behind Show more, and a compact size fits walls and narrow columns.
On this page
- A wall of replies on a landing page
- A post quoted in a blog article
- Launch day reactions
- Mentions in a changelog
- A press or social proof strip
Examples
Long text
Compact, with initials and with media
Accessibility
- The card is an article named by the author. Its link comes first in the tab order and is named for what it opens: "Open Maya Okafor's post on X". Change the word with
noun("reply"). - Links in the text are separate links after it, so a keyboard reaches each one; the card link covers the rest of the card for the pointer.
- Show more is a button with aria-expanded and aria-controls pointing at the text.
- The verified check is an image named "Verified". The source mark and the avatar are decoration, because the name and the link already say who and where.
- Give each picture an alt text; an empty alt marks it as decoration.
Installation
npx knowns-ui@latest add social-postPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Social Post from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/social-post
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add social-post
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- lib/knowns/social.tsx
- components/ui/knowns/social-post.tsx
- components/ui/knowns/social-post-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/social-post, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "social-post" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- name
string- Display name. Names the card for a screen reader.
- handle
string- Shown as @handle. "maya" and "@maya" both work.
- avatar
string- Photo URL. Without it, or when it fails, initials show.
- verified
boolean- Default
false - A check after the name, announced as Verified.
- text
string- The post, word for word. Line breaks are kept.
- media
{ src, alt, width?, height? }[]- Up to four pictures under the text.
- date
string|number|Date- When it was posted, printed as "Nov 24, 2026" in UTC.
- href
string- The original. The whole card links there in a new tab.
- source
SocialKind- Default
from href - The network: sets the source mark and where @mentions and #tags point.
- size
"default"|"compact"- Default
"default" - Compact for walls and narrow columns.
- clamp
number- Default
0 - Cut the text after this many lines and show Show more. 0 shows it all.
- expanded
boolean- Whether clamped text is open (controlled).
- defaultExpanded
boolean- Default
false - The first state when expanded is not set.
- onExpandedChange
(open: boolean) => void- Called by Show more and Show less.
- linkify
boolean- Default
true - Turn links, @mentions and #tags in the text into links.
- noun
string- Default
"post" - The word in the card link's name.
- hideSource
boolean- Default
false - Hide the network mark in the corner.
- footer
ReactNode- Anything after the date, such as a count you keep.
- VerifiedMark
{ className? }- The check on its own, exported for a name line elsewhere.
- postSegments
(text, source?, links?) => PostSegment[]- The text split into plain runs, links, mentions and tags; joins back to the exact text.
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | - | Display name. Names the card for a screen reader. |
| handle | string | - | Shown as @handle. "maya" and "@maya" both work. |
| avatar | string | - | Photo URL. Without it, or when it fails, initials show. |
| verified | boolean | false | A check after the name, announced as Verified. |
| text | string | - | The post, word for word. Line breaks are kept. |
| media | { src, alt, width?, height? }[] | - | Up to four pictures under the text. |
| date | string | number | Date | - | When it was posted, printed as "Nov 24, 2026" in UTC. |
| href | string | - | The original. The whole card links there in a new tab. |
| source | SocialKind | from href | The network: sets the source mark and where @mentions and #tags point. |
| size | "default" | "compact" | "default" | Compact for walls and narrow columns. |
| clamp | number | 0 | Cut the text after this many lines and show Show more. 0 shows it all. |
| expanded | boolean | - | Whether clamped text is open (controlled). |
| defaultExpanded | boolean | false | The first state when expanded is not set. |
| onExpandedChange | (open: boolean) => void | - | Called by Show more and Show less. |
| linkify | boolean | true | Turn links, @mentions and #tags in the text into links. |
| noun | string | "post" | The word in the card link's name. |
| hideSource | boolean | false | Hide the network mark in the corner. |
| footer | ReactNode | - | Anything after the date, such as a count you keep. |
| VerifiedMark | { className? } | - | The check on its own, exported for a name line elsewhere. |
| postSegments | (text, source?, links?) => PostSegment[] | - | The text split into plain runs, links, mentions and tags; joins back to the exact text. |
What it handles
- 01Keeps the text word for word: line breaks stay, links, @mentions and #tags become links, and nothing is rewritten or translated.
- 02Makes the whole card one link to the original in a new tab, while the links inside the text and the Show more button stay their own targets.
- 03Reads the network from the link (x.com is X, threads.com is Threads) for the source mark and for where mentions and tags point.
- 04Cuts long text after the lines you choose and shows Show more only when the text really is longer.
- 05Falls back to initials when there is no photo or it fails to load.
- 06Prints the date the same way on the server and in the browser (UTC), so nothing changes when the page hydrates.
States
- Default
- Avatar, name, verified mark, handle, source mark, the text, the date
- none
- Hover (with a link)
- The card surface tints a little
- colour, 120ms
- Clamped
- The text stops after `clamp` lines with Show more under it
- none
- Expanded
- The full text with Show less
- instant
- No photo
- Initials on a tint in the same circle
- none
- Compact
- Smaller avatar, type and padding for walls and narrow columns
- none
| State | What moves | Timing |
|---|---|---|
| Default | Avatar, name, verified mark, handle, source mark, the text, the date | none |
| Hover (with a link) | The card surface tints a little | colour, 120ms |
| Clamped | The text stops after `clamp` lines with Show more under it | none |
| Expanded | The full text with Show less | instant |
| No photo | Initials on a tint in the same circle | none |
| Compact | Smaller avatar, type and padding for walls and narrow columns | none |
Works with
When to use
When to use
- One post or reply from X, Threads or another network, word for word, linking to the original.
- Cards in a wall of replies or a launch recap, with the compact size.
When not to use
- A comment thread in your own app: use Comment.
- A customer quote with a role and company: use Testimonials.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Social Post to my app and wire it to my own data.
- I need one post or reply from X, Threads or another network, word for word, linking to the original. Set that up with the Knowns UI Social Post.
- Which Social Post props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "social-post" }) and search_docs({ query: "social post" }).