Section Card
section-carduiCard variant tuned for settings pages — title, description, and content slots, with optional footer for save/cancel actions. The block-level building block for `.../settings/*` routes.
Installation
$pnpm dlx shadcn@latest add https://uipkge.dev/r/react/section-card.json$npx shadcn@latest add https://uipkge.dev/r/react/section-card.json$yarn dlx shadcn@latest add https://uipkge.dev/r/react/section-card.json$bunx shadcn@latest add https://uipkge.dev/r/react/section-card.jsonNamed registry:
npx shadcn@latest add @uipkge-react/section-cardInstalls to:components/ui/section-card/Examples
Loading interactive previews…
Loading interactive previews…
Props
| Name | Type / Values | Default | Required |
|---|---|---|---|
title | string | — | required |
description | string | — | optional |
className | string | — | optional |
contentClassName | string | — | optional |
headerAction`header-action` named slot. | React.ReactNode | — | optional |
footerequivalent of the `footer` named slot. | React.ReactNode | — | optional |
children | React.ReactNode | — | optional |
Includes
Used by
Files installed (2)
components/ui/section-card/section-card.tsx1.5 kB
import * as React from 'react' import { cn } from '@/lib/utils' import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card' export interface SectionCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> { title: string description?: string className?: string contentClassName?: string /** Rendered top-right of the header — the React equivalent of the * `header-action` named slot. */ headerAction?: React.ReactNode /** Rendered after the content, outside CardContent — the React * equivalent of the `footer` named slot. */ footer?: React.ReactNode children?: React.ReactNode } const SectionCard = React.forwardRef<HTMLDivElement, SectionCardProps>( ({ title, description, className, contentClassName, headerAction, footer, children, ...rest }, ref) => ( <Card ref={ref} className={cn('flex flex-col', className)} {...rest}> <CardHeader className="pb-4"> <div className="flex flex-wrap items-center justify-between gap-2"> <div className="min-w-0"> <CardTitle className="text-base font-semibold">{title}</CardTitle> {description && <CardDescription className="mt-0.5">{description}</CardDescription>} </div> {headerAction} </div> </CardHeader> <CardContent className={cn('flex-1', contentClassName)}>{children}</CardContent> {footer} </Card> ), ) SectionCard.displayName = 'SectionCard' export { SectionCard }components/ui/section-card/index.ts0.1 kB
export { SectionCard, type SectionCardProps } from './section-card'
Raw manifest:https://uipkge.dev/r/react/section-card.json