BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-htmx/card

Card

shadcn-htmx/card
FreeComponent

Structural container — Header / Title / Description / Action / Content / Footer slots. Pure layout primitive; pair with htmx for content swaps.

Live preview

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

Install it

npx shadcn@latest add https://shadcn-htmx.productdevbook.com/r/card.json

Source

registry/ui/card.tsxshadcn-htmx.productdevbook.com/r/card.json
1/** @jsxImportSource hono/jsx */
2import type { PropsWithChildren } from "hono/jsx"
3import { cn, type ClassValue } from "@/registry/lib/cn"
4
5// Card — shadcn-htmx, htmx v4 + Tailwind v4.
6//
7// Source of truth (1:1 class strings):
8// repos/shadcn-ui/apps/v4/registry/new-york-v4/ui/card.tsx
9//
10// Card is structural — a rounded container with a Header / Title /
11// Description / Content / Footer layout. No interactivity, no JS.
12// Pair it with htmx attributes on inner elements when you need to swap
13// the contents server-side.
14
15type CardAs = "div" | "article" | "section" | "li" | "aside"
16
17export function Card(
18 props: PropsWithChildren<
19 {
20 class?: ClassValue
21 id?: string
22 // Semantic element. shadcn upstream hardcodes <div>; we default to
23 // <div> for backwards-compat but encourage <article> for self-
24 // contained content (product card, blog tile, comment) and
25 // <section> for thematic groups inside a landmark.
26 // See repos/mdn/files/en-us/web/html/reference/elements/article/index.md:10,65-68
27 as?: CardAs
28 // Pair with the id of the CardTitle inside so the rendered <article>
29 // / <section> has an accessible name for AT landmark navigation.
30 ariaLabelledby?: string
31 ariaLabel?: string
32 } & Record<string, any>
33 >,
34) {
35 const { class: className, children, as = "div", ariaLabelledby, ariaLabel, ...rest } = props
36 const Tag: any = as
37 return (
38 <Tag
39 data-slot="card"
40 class={cn(
41 "flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
42 className,
43 )}
44 aria-labelledby={ariaLabelledby}
45 aria-label={ariaLabel}
46 {...rest}
47 >
48 {children}
49 </Tag>
50 )
51}
52
53export function CardHeader(
54 props: PropsWithChildren<{ class?: ClassValue }>,
55) {
56 return (
57 <div
58 data-slot="card-header"
59 class={cn(
60 "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
61 props.class,
62 )}
63 >
64 {props.children}
65 </div>
66 )
67}
68
69type CardTitleAs = "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
70
71export function CardTitle(
72 props: PropsWithChildren<{
73 class?: ClassValue
74 // Render as a real heading so an `as="article"|"section"` Card gets a
75 // child heading and contributes to the document outline. Default "div"
76 // preserves shadcn upstream behaviour.
77// … truncated

Facts

Registry
shadcn-htmx
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

Docs on shadcn-htmx shadcn-htmx.productdevbook.com productdevbook/shadcn-htmx on GitHub Raw registry item This item as JSON

More from shadcn-htmx

All 83 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionshadcn-htmxComponentsFreeno deps
Active Searchactive-searchshadcn-htmxComponentsFreeno deps
Alertalertshadcn-htmxComponentsFreeno deps
Alert Dialogalert-dialogshadcn-htmxComponentsFreeno deps
Aspect Ratioaspect-ratioshadcn-htmxComponentsFreeno deps
Auto Gridauto-gridshadcn-htmxComponentsFreeno deps
Autocompleteautocompleteshadcn-htmxComponentsFreeno deps
Autosize Textareaautosize-textareashadcn-htmxComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex