Article
gymnopedies/articleFreeComponent
Article — gymnopédies blog reading primitive.
Install it
npx shadcn@latest add https://gymnopedies.shoota.work/r/article.jsonSource
1import * as React from "react"23import { cn } from "@/lib/utils"4import { Picture } from "@/components/blog/picture"56/**7 * <Article /> — the gymnopédies article card.8 *9 * This is the v1 `core/Card` component, brought back as a blog primitive10 * (the shadcn-flavoured `ui/Card` is intentionally separate). Props, defaults11 * and text styling match the legacy implementation:12 *13 * - dark teal surface (`bg-card`) with a soft glow shadow14 * - 16:9 image header rendered through gymnopédies' <Picture /> so the15 * legacy grayscale → hover-reveal animation is preserved16 * - serif heading in `--accent` with a gold glow shadow17 * - body copy in `--foreground` with a light-blur text shadow18 * - optional supplementary `content` paragraph in `--accent` (xs)19 */2021export type ArticleSize = "xs" | "sm" | "md" | "lg" | "xl"2223export type ArticleProps = {24 title: string25 description: string26 content?: string27 size?: ArticleSize28 image?: {29 src: string30 alt: string31 caption?: React.ReactNode32 }33 className?: string34}3536const sizeMaxWidth: Record<ArticleSize, string> = {37 xs: "max-w-[12rem]", // 192px38 sm: "max-w-[20rem]", // 320px39 md: "max-w-[28rem]", // 448px40 lg: "max-w-[36rem]", // 576px41 xl: "max-w-[48rem]", // 768px42}4344export function Article({45 title,46 description,47 content,48 size = "sm",49 image,50 className,51}: ArticleProps) {52 return (53 <article54 className={cn(55 "flex w-full flex-col overflow-hidden rounded-lg bg-card shadow-soft-glow",56 sizeMaxWidth[size],57 className,58 )}59 >60 {image && (61 <div className="aspect-[16/9] w-full overflow-hidden">62 <Picture className="h-full rounded-none bg-card">63 <Picture.Image64 src={image.src}65 alt={image.alt}66 transition67 className="h-full rounded-none"68 />69 {image.caption ? (70 <Picture.Caption>{image.caption}</Picture.Caption>71 ) : null}72 </Picture>73 </div>74 )}75 <div className="flex flex-col gap-3 p-6">76 <h377 className={cn(78 "m-0 text-xl font-bold leading-tight text-accent",79 "[text-shadow:var(--text-shadow-glow)]",80 )}81 >82 {title}83 </h3>84 <p85 className={cn(86 "m-0 text-base leading-[1.5] text-foreground",87 "[text-shadow:var(--text-shadow-light-blur)]",88 )}89 >90// … truncated
What it pulls in
Other registry items
Files it writes
More from gymnopedies
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | gymnopedies | Components | Free | 2 deps | |
| Alertalert | gymnopedies | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | gymnopedies | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | gymnopedies | Components | Free | no deps | |
| Avataravatar | gymnopedies | Components | Free | 1 dep | |
| Badgebadge | gymnopedies | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | gymnopedies | Components | Free | 2 deps | |
| Buttonbutton | gymnopedies | Components | Free | 2 deps |
