JGuang

Tweet Card

Tweet Card · Magic UI

Preview
npx shadcn@latest add https://jiguang132.com/r/magic-ui/tweet-card.json

Some upstream demos use online images, videos or tweets. That content depends on network access and third-party services.

Tweet Card

Install: npx shadcn@latest add https://jiguang132.com/r/magic-ui/tweet-card.json

Use case

Render a tweet from the server-oriented native TweetCard API.

Native props used by the examples

Extracted from all local examples for this entry, grouped by imported module and native owner, including other Magic components used by compound demos. This is not an exhaustive API or a universal host variant. Inspect spread object declarations and the source types/defaults below.

Owning component propExplanationExample source
ClientTweetCard.id (client-tweet-card)Public tweet identifier, not an authentication token.examples/tweet-card-demo.tsx、examples/tweet-card-images.tsx、examples/tweet-card-meta-preview.tsx
ClientTweetCard.className (client-tweet-card)Classes on this native component; initialize Tailwind and its required CSS first.examples/tweet-card-images.tsx、examples/tweet-card-meta-preview.tsx

Interaction and state checks

  • Tweet Card Demo — tweet-card-demo
  • Tweet Card Images — tweet-card-images
  • Tweet Card Meta Preview — tweet-card-meta-preview

These names identify real example entries, not new component props or extra components. Check pointer/keyboard behavior, themes, small screens and failures for the selected example. Decorative effects must not invent disabled/error/submission states. Complete example installation includes the actual dependency closure.

Business integration boundary

The browser gallery uses ClientTweetCard, not the async server component. Server use needs a compatible server runtime; remote tweets can be unavailable.

Host and motion setup

Initialize Tailwind CSS v4, semantic CSS variables and the dark variant; import the independent local Registry namespace. Reuse an existing next-themes Provider without substituting JGuang UI/Base UI/HeroUI APIs. Mount effects in view and unmount offscreen; provide static alternatives for unavailable Canvas/WebGL or failed remote media. Respect prefers-reduced-motion and verify timer/RAF/observer/listener cleanup: stopping CSS alone does not prove the engine stopped. Examples provide no backend, login, payment or real AI stream. This practical guide is bilingual; detailed upstream references and demo text retain their original language.

Available examples

tweet-card-demo, tweet-card-images, tweet-card-meta-preview

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.

Installation

<Tabs defaultValue="cli"> <TabsList> <TabsTrigger value="cli">CLI</TabsTrigger> <TabsTrigger value="manual">Manual</TabsTrigger> </TabsList> <TabsContent value="cli">
npx shadcn@latest add @magicui/tweet-card
</TabsContent> <TabsContent value="manual"> <Steps>

<Step>Install the dependencies.</Step>

npm install react-tweet

Installation React Server Component (Next.js 13+):

Copy and paste the following code into your project.

Installation Client Side

Copy and paste the following code into your project.

<Step>Update the import paths to match your project setup.</Step>

</Steps> </TabsContent> </Tabs>

Usage

To render on server side using RSC (Next.js 13):

import { TweetCard } from "@/components/ui/tweet-card"

export default async function App() {
  return <TweetCard id="1441032681968212480" />
}

To render on client side:

"use client"

import { ClientTweetCard } from "@/components/ui/client-tweet-card"

export default function App() {
  return <ClientTweetCard id="1441032681968212480" />
}

Examples

Tweet Card With Meta URL Preview

Props

ClientTweetCard

PropTypeDefaultDescription
idstring-The id of the tweet to display.

TweetCard

PropTypeDefaultDescription
idstring-The id of the tweet to display.

Credits

This component is built on top of React Tweet.

Complete example installation

The component command installs the component. Each example command also includes its actual imported components, native support UI, utilities and pinned dependencies. Helpers are not additional catalog components.

Tweet Card Demo

npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/tweet-card/tweet-card-demo.json

Default import: @/components/magicui/examples/tweet-card-demo

Dependencies: clsx@2.1.1, react-tweet@3.2.2, tailwind-merge@3.6.0

Tweet Card Images

npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/tweet-card/tweet-card-images.json

Default import: @/components/magicui/examples/tweet-card-images

Dependencies: clsx@2.1.1, react-tweet@3.2.2, tailwind-merge@3.6.0

Tweet Card Meta Preview

npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/tweet-card/tweet-card-meta-preview.json

Default import: @/components/magicui/examples/tweet-card-meta-preview

Dependencies: clsx@2.1.1, react-tweet@3.2.2, tailwind-merge@3.6.0

Minimal usage and theme

import Demo from '@/components/magicui/examples/tweet-card-demo';
import { ThemeProvider } from 'next-themes';
export default function Example() {
  return <ThemeProvider attribute="class" defaultTheme="system" enableSystem><Demo /></ThemeProvider>;
}

Initialize Tailwind CSS v4, semantic color variables and the dark variant first. Reuse an existing next-themes provider rather than nesting another. Next Link examples require a Next.js environment; in static Vite projects adapt the demo links to your router without changing the native component API. Some media and tweets require network access. Examples do not supply authentication or backend services.

Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.

TweetSkeleton({
  className,
  ...props
}: {
  className?: string
  [key: string]: unknown
})

TweetNotFound({
  className,
  ...props
}: {
  className?: string
  [key: string]: unknown
})

TweetHeader({ tweet }: { tweet: EnrichedTweet })

TweetBody({ tweet }: { tweet: EnrichedTweet })

TweetMedia({ tweet }: { tweet: EnrichedTweet })

MagicTweet({
  tweet,
  className,
  ...props
}: {
  tweet: Tweet
  className?: string
})

TweetCard({
  id,
  components,
  fallback = <TweetSkeleton />,
  onError,
  ...props
}: TweetProps & {
  className?: string
})

Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.

// TweetCard
fallback = <TweetSkeleton />

Native and external types

External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.

EnrichedTweet
Tweet
TweetProps