Card
solid-ui/cardFreeComponent
A card component
Live preview
live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solid-ui.com/r/card.jsonSource
1import type { Component, ComponentProps } from "solid-js"2import { splitProps } from "solid-js"34import { cn } from "~/lib/utils"56const Card: Component<ComponentProps<"div">> = (props) => {7 const [local, others] = splitProps(props, ["class"])8 return (9 <div10 class={cn("rounded-lg border bg-card text-card-foreground shadow-sm", local.class)}11 {...others}12 />13 )14}1516const CardHeader: Component<ComponentProps<"div">> = (props) => {17 const [local, others] = splitProps(props, ["class"])18 return <div class={cn("flex flex-col space-y-1.5 p-6", local.class)} {...others} />19}2021const CardTitle: Component<ComponentProps<"h3">> = (props) => {22 const [local, others] = splitProps(props, ["class"])23 return (24 <h3 class={cn("text-lg font-semibold leading-none tracking-tight", local.class)} {...others} />25 )26}2728const CardDescription: Component<ComponentProps<"p">> = (props) => {29 const [local, others] = splitProps(props, ["class"])30 return <p class={cn("text-sm text-muted-foreground", local.class)} {...others} />31}3233const CardContent: Component<ComponentProps<"div">> = (props) => {34 const [local, others] = splitProps(props, ["class"])35 return <div class={cn("p-6 pt-0", local.class)} {...others} />36}3738const CardFooter: Component<ComponentProps<"div">> = (props) => {39 const [local, others] = splitProps(props, ["class"])40 return <div class={cn("flex items-center p-6 pt-0", local.class)} {...others} />41}4243export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
What it pulls in
npm packages
Files it writes
More from solid-ui
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | solid-ui | Components | Free | 2 deps | |
| Alertalert | solid-ui | Components | Free | 3 deps | |
| Alert Dialogalert-dialog | solid-ui | Components | Free | 2 deps | |
| Aspect Ratioaspect-ratio | solid-ui | Components | Free | 1 dep | |
| Avataravatar | solid-ui | Components | Free | 2 deps | |
| Badgebadge | solid-ui | Components | Free | 2 deps | |
| Badge Deltabadge-delta | solid-ui | Components | Free | 2 deps | |
| Bar Listbar-list | solid-ui | Components | Free | 1 dep |
