BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/delta-components/x-card

x-card

delta-components/x-card
FreeComponent

delta-components publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://deltacomponents.dev/r/x-card.json

Source

components/ui/x-card.tsxdeltacomponents.dev/r/x-card.json
1"use client"
2
3import { type ReactNode } from "react"
4import { Tweet } from "react-tweet"
5
6import { cn } from "@/lib/utils"
7
8type XCardSize = "sm" | "small" | "default" | "lg" | "large"
9
10interface XCardProps {
11 id: string
12 caption?: ReactNode
13 className?: string
14 size?: XCardSize
15}
16
17function normalizeSize(size: XCardSize): "small" | "default" | "large" {
18 if (size === "sm") return "small"
19 if (size === "lg") return "large"
20 return size as "small" | "default" | "large"
21}
22
23export function XCard({
24 id,
25 caption,
26 className,
27 size = "default",
28}: XCardProps) {
29 const normalizedSize = normalizeSize(size)
30
31 const sizeClasses = {
32 small: "max-w-sm scale-90",
33 default: "max-w-xl",
34 large: "max-w-2xl scale-110",
35 }
36
37 return (
38 <div className={cn("x-card my-6", sizeClasses[normalizedSize], className)}>
39 <div className="flex justify-center">
40 <Tweet id={id} />
41 </div>
42 {caption && (
43 <div className="text-muted-foreground mt-4 text-center text-sm">
44 {caption}
45 </div>
46 )}
47 <style jsx>{`
48 .x-card .react-tweet-theme {
49 --tweet-container-margin: 0;
50 --tweet-font-family: inherit;
51 --tweet-font-color: hsl(var(--foreground));
52 --tweet-bg-color: hsl(var(--card));
53 --tweet-bg-color-hover: hsl(var(--card));
54 --tweet-color-blue-secondary: hsl(var(--muted-foreground));
55 --tweet-color-blue-secondary-hover: hsl(var(--accent));
56 --tweet-font-color-secondary: hsl(var(--muted-foreground));
57 --tweet-quoted-bg-color-hover: hsl(var(--muted) / 0.3);
58 --tweet-border: 1px solid hsl(var(--border));
59 --tweet-skeleton-gradient: linear-gradient(
60 270deg,
61 hsl(var(--muted)),
62 hsl(var(--muted) / 0.8),
63 hsl(var(--muted) / 0.8),
64 hsl(var(--muted))
65 );
66 --tweet-color-red-primary: hsl(var(--destructive));
67 --tweet-color-red-primary-hover: hsl(var(--destructive) / 0.1);
68 --tweet-color-green-primary: hsl(var(--chart-2));
69 --tweet-color-green-primary-hover: hsl(var(--chart-2) / 0.1);
70 --tweet-twitter-icon-color: hsl(var(--foreground));
71 --tweet-verified-old-color: hsl(var(--muted-foreground));
72 --tweet-verified-blue-color: hsl(var(--primary));
73 }
74
75 .x-card .react-tweet-theme p {
76 font-size: inherit;
77 line-height: 1.3rem;
78 }
79
80// … truncated

What it pulls in

npm packages

  • react-tweet

Files it writes

  • registry/delta-ui/delta/x-card.tsx

Facts

Registry
delta-components
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

Docs on delta-components deltacomponents.dev pprunty/deltacomponents.dev on GitHub Raw registry item This item as JSON

More from delta-components

All 93 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
admonitionadmonitiondelta-componentsComponentsFree1 dep
cambio-imagecambio-imagedelta-componentsComponentsFree2 deps
card-deckcard-deckdelta-componentsComponentsFree3 deps
chatchatdelta-componentsComponentsFree3 deps
code-blockcode-blockdelta-componentsComponentsFree3 deps
code-block-iconscode-block-iconsdelta-componentsComponentsFreeno deps
copy-buttoncopy-buttondelta-componentsComponentsFree1 dep
input-otpinput-otpdelta-componentsComponentsFree1 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