Skip to content

UIGroup

Expanded group with items
Source Files
3 files
Collapsed group
Tests
5 files
With metadata and actions
Pull Request #42Open
feat: add dark mode
src/theme.ts+42 -10
Modified
src/colors.ts+15 -3
Modified
Empty group
Recent Activity
No activity yet
PropTypeDefaultDescription
titleReactNoderequiredGroup header title
subtitleReactNodeSecondary text below title
expandedbooleantrueWhether the group body is visible
activebooleanfalseHighlights the group
animatebooleanEnables collapse animation
metaReactNodeMetadata next to the title (badges, counts)
actionsReactNodeAction buttons in the header (won’t trigger toggle)
showCaretbooleantrueShows the expand/collapse caret
onToggle(nextExpanded: boolean) => voidMakes header clickable for expand/collapse
childrenReactNodeGroup body content
PropTypeDefaultDescription
titlestringrequiredItem title
subtitlestringSecondary text
metaReactNodeRight-side metadata
activebooleanfalseHighlights the item
onClick() => voidMakes item clickable
PropTypeDefaultDescription
textstringrequiredEmpty state message
import { UIGroup, UIGroupList, UIGroupItem, UIGroupEmpty, UIBadge } from "tango-api";
const [expanded, setExpanded] = useState(true);
<UIGroup title="Files" subtitle={`${files.length} items`} expanded={expanded} onToggle={setExpanded}>
<UIGroupList>
{files.length === 0 ? (
<UIGroupEmpty text="No files found" />
) : (
files.map((file) => (
<UIGroupItem
key={file.path}
title={file.name}
subtitle={file.path}
meta={<UIBadge label={file.status} tone="info" />}
onClick={() => selectFile(file)}
/>
))
)}
</UIGroupList>
</UIGroup>