BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/spell-ui/tweet

Tweet

spell-ui/tweet
FreeComponent

Embed Twitter/X posts with custom styling.

Live preview

live · rendered by the registry
Rendered by spell-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://spell.sh/r/tweet.json

Source

registry/spell-ui/tweet.tsxspell.sh/r/tweet.json · first 6 KB
1"use client";
2
3import { useState } from "react";
4import {
5 enrichTweet,
6 useTweet,
7 type EnrichedTweet,
8} from "react-tweet";
9import { cn } from "@/lib/utils";
10import { Check, Link2 } from "lucide-react";
11import { SiX } from "@icons-pack/react-simple-icons";
12
13const VerifiedBadge = ({ className }: { className?: string }) => (
14 <svg
15 viewBox="0 0 22 22"
16 className={className}
17 fill="currentColor"
18 aria-label="Verified account"
19 role="img"
20 >
21 <path d="M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z" />
22 </svg>
23);
24
25const formatNumber = (num: number): string => {
26 if (num >= 1000000) {
27 return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
28 }
29 if (num >= 1000) {
30 return (num / 1000).toFixed(1).replace(/\.0$/, "") + "k";
31 }
32 return num.toString();
33};
34
35const formatDate = (dateString: string): string => {
36 const date = new Date(dateString);
37 const hours = date.getHours();
38 const minutes = date.getMinutes();
39 const ampm = hours >= 12 ? "PM" : "AM";
40 const hour12 = hours % 12 || 12;
41 const monthNames = [
42 "Jan",
43 "Feb",
44 "Mar",
45 "Apr",
46 "May",
47 "Jun",
48 "Jul",
49 "Aug",
50 "Sep",
51 "Oct",
52 "Nov",
53 "Dec",
54 ];
55 const month = monthNames[date.getMonth()];
56 const day = date.getDate();
57 const year = date.getFullYear();
58
59 return `${hour12}:${minutes.toString().padStart(2, "0")} ${ampm} · ${month} ${day}, ${year}`;
60};
61
62const TweetSkeleton = ({ className }: { className?: string }) => (
63 <div
64 className={cn(
65// … truncated

What it pulls in

npm packages

  • react-tweet
  • @icons-pack/react-simple-icons

Files it writes

  • registry/spell-ui/tweet.tsx

Facts

Registry
spell-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on spell-ui spell.sh xxtomm/spell-ui on GitHub Raw registry item This item as JSON

More from spell-ui

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Checkboxanimated-checkboxspell-uiComponentsFree1 dep
Animated Gradientanimated-gradientspell-uiComponentsFreeno deps
Badgebadgespell-uiComponentsFree2 deps
Bars Spinnerbars-spinnerspell-uiComponentsFreeno deps
Blur Revealblur-revealspell-uiComponentsFree1 dep
Chartchartspell-uiComponentsFreeno deps
Color Selectorcolor-selectorspell-uiComponentsFreeno deps
Copy Buttoncopy-buttonspell-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex