Panel
blacksite/panelFreeComponent
Titled card panel with header bar, action slot and status indicator.
Install it
npx shadcn@latest add https://blacksite.sh/r/panel.jsonSource
1"use client";23import * as React from "react";4import { X } from "lucide-react";56import { cn } from "@/lib/utils";7import { StatusBadge, type StatusBadgeProps } from "@/registry/blacksite/ui/status-badge";89interface PanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {10 /** Panel title (rendered uppercase + monospace). */11 title?: React.ReactNode;12 /** Optional secondary title segment after a slash divider. */13 subtitle?: React.ReactNode;14 /** Status badge shown on the right of the header. */15 status?: StatusBadgeProps["status"];16 /** Custom slot for header right-side controls. */17 actions?: React.ReactNode;18 /** Show a close (X) button. */19 closable?: boolean;20 onClose?: () => void;21 /** Density: "default" 16px padding, "compact" 12px. */22 density?: "default" | "compact";23 /** Hide the inner padding (e.g. for full-bleed maps/charts). */24 bleed?: boolean;25}2627const Panel = React.forwardRef<HTMLDivElement, PanelProps>(28 (29 {30 className,31 title,32 subtitle,33 status,34 actions,35 closable,36 onClose,37 density = "default",38 bleed = false,39 children,40 ...props41 },42 ref,43 ) => {44 return (45 <section46 ref={ref}47 className={cn(48 "border-border bg-card text-card-foreground relative flex flex-col rounded-md border",49 "overflow-hidden shadow-[var(--shadow-panel)]",50 className,51 )}52 {...props}53 >54 {(title || actions || status || closable) && (55 <header56 className={cn(57 "border-border flex items-center justify-between gap-3 border-b",58 density === "compact" ? "h-8 px-2.5" : "h-9 px-3",59 )}60 >61 <div className="flex min-w-0 items-center gap-2">62 {title && (63 <h3 className="text-mono text-foreground-muted truncate text-[11px] tracking-[0.1em] uppercase">64 {title}65 {subtitle && <span className="text-foreground-subtle"> / {subtitle}</span>}66 </h3>67 )}68 </div>69 <div className="flex items-center gap-2">70 {actions}71 {status && <StatusBadge status={status} />}72 {closable && (73 <button74 type="button"75 aria-label="Close panel"76 onClick={onClose}77// … truncated
More from blacksite
All 25 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| App headerapp-header | blacksite | Components | Free | no deps | |
| Badgebadge | blacksite | Components | Free | no deps | |
| Bar chartbar-chart | blacksite | Components | Free | no deps | |
| Buttonbutton | blacksite | Components | Free | no deps | |
| Cardcard | blacksite | Components | Free | no deps | |
| Chart tooltipchart-tooltip | blacksite | Components | Free | no deps | |
| Data listdata-list | blacksite | Components | Free | no deps | |
| Gantt timelinegantt-timeline | blacksite | Components | Free | no deps |
