Tweet Card, Client Side
Tweet Card, Client Side is a React and Tailwind CSS card component from Magic UI, licensed MIT. Copy it and paste it into your project.
Magic UI
MIT
cards
What it is
Tweet Card, Client Side is a React and Tailwind CSS card component from Magic UI, licensed MIT. Copy it and paste it into your project.
How to use it
Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.
Five free copies a month. No card.
Needs
npm i react-tweet
Licence
This component comes from Magic UI and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.
Tweet Card, Client Side
"use client"
import { useTweet, type TweetProps } from "react-tweet"
import {
MagicTweet,
TweetNotFound,
TweetSkeleton,
} from "@/registry/magicui/tweet-card"
export const ClientTweetCard = ({
id,
apiUrl,
fallback = <TweetSkeleton />,
components,
fetchOptions,
onError,
...props
}: TweetProps & { className?: string }) => {
const { data, error, isLoading } = useTweet(id, apiUrl, fetchOptions)
if (isLoading) return fallback
if (error || !data) {
const NotFound = components?.TweetNotFound ?? TweetNotFound
return <NotFound error={onError ? onError(error) : error} />
}
return <MagicTweet tweet={data} {...props} />
}