Split Panel
v0.3.5Two-panel layout with a scrollable navigation list and a main content panel. Includes list item, list header, and empty-detail helper components.
Install
npx shadcn@latest add @signalos/split-panelRequires a configured @signalos registry and a valid SIGNALOS_REGISTRY_TOKEN - get access. Registry dependencies (@signalos/tokens, @signalos/utils, @signalos/tooltip) are pulled automatically.
Preview
Example & code
split-panel.example.tsx
import { useState } from "react"
import {
SplitPanel,
SplitPanelEmptyDetail,
SplitPanelListHeader,
SplitPanelListItem,
} from "./SplitPanel"
const contacts = [
{ id: "1", name: "Ada Lovelace", subtitle: "Engineering" },
{ id: "2", name: "Grace Hopper", subtitle: "Engineering" },
{ id: "3", name: "Margaret Hamilton", subtitle: "Product" },
]
export default function Example() {
const [activeId, setActiveId] = useState<string | null>(null)
const active = contacts.find((c) => c.id === activeId)
return (
<div className="h-96">
<SplitPanel
listWidth="w-72"
list={
<>
<SplitPanelListHeader title="Contacts" />
{contacts.map((contact) => (
<SplitPanelListItem
key={contact.id}
title={contact.name}
subtitle={contact.subtitle}
active={contact.id === activeId}
onClick={() => setActiveId(contact.id)}
/>
))}
</>
}
detail={
active ? (
<div className="p-6">
<h2 className="text-lg font-semibold">{active.name}</h2>
<p className="text-sm text-muted-foreground">{active.subtitle}</p>
</div>
) : (
<SplitPanelEmptyDetail />
)
}
/>
</div>
)
}
Props
SplitPanelListItemProps
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | ReactNode | - | Primary label for the item. |
| subtitle | ReactNode | - | Secondary line under the title. |
| icon | ReactNode | - | Leading icon or avatar. |
| badge | ReactNode | - | Trailing badge/status indicator. |
| active | boolean | undefined | - | Marks the item as the currently selected one. |
| onClick | (() => void) | undefined | - | |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root element. |
SplitPanelListHeaderProps
| Prop | Type | Default | Description |
|---|---|---|---|
| title | ReactNode | - | Header title. |
| actions | ReactNode | - | Trailing actions (buttons, icons, etc.). |
| className | string | undefined | - | |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root element. |
SplitPanelEmptyDetailProps
| Prop | Type | Default | Description |
|---|---|---|---|
| message | ReactNode | - | Message shown when no item is selected. |
| className | string | undefined | - | |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root element. |
SplitPanelProps
| Prop | Type | Default | Description |
|---|---|---|---|
| list* | ReactNode | - | Left panel content. |
| detail* | ReactNode | - | Main panel content. |
| listWidth | string | undefined | - | Width utility class for the left panel. Example: "w-64" "w-72" "w-80" |
| className | string | undefined | - | Additional classes. |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root element. |
Changelog
0.3.5
- Content updates.
0.3.3
- Content updates.
split-panel
0.3.1
- Breaking: rename the
testIdprop todata-testidto match the rest of the registry and the DOM attribute name.
0.2.3
- Format source with the repo prettier config (no behavior change).
0.2.2
- Content sync fix to bring source in line with published registry payload.
- Flattened
components/subfolder into the widget root (SplitPanelListItem,SplitPanelListHeader,SplitPanelEmptyDetail). - Fixed manifest: corrected description, dropped unused
lucide-react/@signalos/button/@signalos/tooltipdependencies, fixed types file path (.ts, not.tsx), listed all shipped files, categorylayout. - Rewrote
.example.tsx,.preview.tsx, and.test.tsxto exerciseSplitPanel(previously copied fromicon-button).
0.1.0
- Initial release.