Card
octane/cardFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/card.jsonSource
1// Base UI base card — presentational, no headless primitive in any base.2//3// UNVERIFIED PROVENANCE: derived from this package's React Aria base rather than transcribed4// from upstream's `bases/base-ui/ui/card.tsx`, which was not available at port time.5// Diff the class strings against the upstream source before treating this as ported.6import { cn } from '@/lib/utils';7import type { DivProps } from '@/lib/types';89export interface CardProps extends DivProps {10 size?: 'default' | 'sm';11}1213export function Card({ className, size = 'default', ...props }: CardProps) @{14 <div15 data-slot="card"16 data-size={size}17 className={cn(18 'group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',19 className,20 )}21 {...props}22 />23}2425export function CardHeader({ className, ...props }: DivProps) @{26 <div27 data-slot="card-header"28 className={cn(29 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)',30 className,31 )}32 {...props}33 />34}3536export function CardTitle({ className, ...props }: DivProps) @{37 <div38 data-slot="card-title"39 className={cn(40 'text-base leading-snug font-medium group-data-[size=sm]/card:text-sm',41 className,42 )}43 {...props}44 />45}4647export function CardDescription({ className, ...props }: DivProps) @{48 <div49 data-slot="card-description"50 className={cn('text-sm text-muted-foreground', className)}51 {...props}52 />53}5455export function CardAction({ className, ...props }: DivProps) @{56 <div57 data-slot="card-action"58 className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}59 {...props}60 />61}6263export function CardContent({ className, ...props }: DivProps) @{64 <div data-slot="card-content" className={cn('px-(--card-spacing)', className)} {...props} />65}6667export function CardFooter({ className, ...props }: DivProps) @{68 <div69 data-slot="card-footer"70 className={cn(71 'flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)',72 className,73 )}74// … truncated
What it pulls in
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
