Panel
scificn/panelFreeComponent
Container with corner notch via clip-path. Composable Panel, PanelHeader, PanelTitle, PanelContent, PanelFooter.
Live preview
live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.scificn.dev/r/panel.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34/* ── Panel (outer container) ── */5export interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {6 notch?: 'sm' | 'md' | 'lg' | 'none'7}89const Panel = React.forwardRef<HTMLDivElement, PanelProps>(10 ({ className, notch = 'md', style, ...props }, ref) => {11 const clipMap = {12 sm: 'var(--clip-corner-sm)',13 md: 'var(--clip-corner-md)',14 lg: 'var(--clip-corner-lg)',15 none: 'none',16 }1718 return (19 <div20 ref={ref}21 className={cn('rounded-none', className)}22 style={{23 background: 'var(--surface)',24 border: '1px solid var(--border)',25 clipPath: clipMap[notch],26 overflow: 'hidden',27 ...style,28 }}29 {...props}30 />31 )32 }33)34Panel.displayName = 'Panel'3536/* ── PanelHeader ── */37const PanelHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(38 ({ className, style, ...props }, ref) => (39 <div40 ref={ref}41 className={cn(className)}42 style={{43 display: 'flex',44 alignItems: 'center',45 padding: '0.6rem 1rem',46 borderBottom: '1px solid var(--border)',47 background: 'var(--surface-raised)',48 gap: '0.5rem',49 ...style,50 }}51 {...props}52 />53 )54)55PanelHeader.displayName = 'PanelHeader'5657/* ── PanelTitle ── */58const PanelTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(59 ({ className, style, ...props }, ref) => (60 <h361 ref={ref}62 className={cn(className)}63 style={{64 fontSize: '0.7rem',65 fontWeight: 600,66 color: 'var(--text-muted)',67 letterSpacing: '0.12em',68 textTransform: 'uppercase',69 margin: 0,70 ...style,71 }}72 {...props}73 />74 )75)76PanelTitle.displayName = 'PanelTitle'7778/* ── PanelContent ── */79const PanelContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(80 ({ className, style, ...props }, ref) => (81 <div82 ref={ref}83 className={cn(className)}84 style={{ padding: '1rem', ...style }}85 {...props}86 />87 )88)89PanelContent.displayName = 'PanelContent'9091/* ── PanelFooter ── */92const PanelFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(93 ({ className, style, ...props }, ref) => (94// … truncated
More from scificn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | scificn | Components | Free | 1 dep | |
| Badgebadge | scificn | Components | Free | 1 dep | |
| Bar Chartbar-chart | scificn | Components | Free | no deps | |
| Breadcrumbbreadcrumb | scificn | Components | Free | no deps | |
| Buttonbutton | scificn | Components | Free | 2 deps | |
| Cardcard | scificn | Components | Free | no deps | |
| Checkboxcheckbox | scificn | Components | Free | 1 dep | |
| Dialogdialog | scificn | Components | Free | 1 dep |
