WAfM components
Sidebar
Project context, participant selection, and diagnostic navigation on the shadcn Sidebar foundation.
Sidebar playground
Participant, comparison, project, and knowledge-base sidebars in a taller preview.
Properties
Usage and props
Import shared components from @wafm/ui. Keep workflow state and data fetching in the application.
ParticipantSidebar
<SidebarProvider>
<ParticipantSidebar
projectName={project.name}
projectSubtitle={project.subtitle}
projectMenu={projectMenuItems}
wishProfileLabel="Wunschprofil 1"
onWishProfileSelect={openWishProfile}
participants={participants}
selectedParticipantId={selectedId}
onParticipantSelect={setSelectedId}
mode={mode}
onModeChange={setMode}
comparisonIds={comparisonIds}
onComparisonChange={setComparisonIds}
footer={<ParticipantSidebarFooter {...footerActions} />}
/>
</SidebarProvider>- projectName / projectSubtitle / projectMenu
- Project title, subtitle, and caller-provided dropdown items. The header opens the dropdown; the app supplies item callbacks and navigation.
- wishProfileLabel / onWishProfileSelect / wishProfileActive / onWishProfileEdit
- Wish-profile text, selection callback, controlled active state, and optional edit action revealed on hover or keyboard focus.
- participants
- Read-only list of unique { id, name } records.
- selectedParticipantId / onParticipantSelect
- Controlled single-profile selection.
- mode / onModeChange (ProfileModeTabs)
- single or compare; controlled tab state passed to the shared ProfileModeTabs.
- comparisonIds / onComparisonChange / comparisonLimit
- Controlled comparison selection. Limit defaults to 6, matching the Figma counter.
- footer / className
- Footer composition and additional container styles.
Sidebar foundation
import { SidebarProvider, Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarTrigger } from '@wafm/ui/components/sidebar'
import { useSidebar } from '@wafm/ui/hooks/use-sidebar'- SidebarProvider: defaultOpen / open / onOpenChange / mobile
- Initial or controlled desktop state. Optional mobile override supports a container-sized preview. Native div props including children, className, style, ref are forwarded. Width variables: --sidebar-width (16rem), --sidebar-width-icon (3rem).
- Sidebar: collapsible
- offcanvas (default), icon, none (desktop). Native div props. All layouts use a Sheet below 768px; desktop sidebar stays in document flow.
- SidebarMenuButton: render / nativeButton / isActive / tooltip
- Compose an element with the Base UI render prop, mark selection, or label a collapsed icon. Set nativeButton=false for non-button elements. Button props include disabled, onClick, children, className, ref.
- SidebarTrigger
- Button props, including onClick and aria-label. Toggles desktop or mobile state.
- SidebarHeader / SidebarContent / SidebarFooter
- Native div props. Content scrolls while header and footer stay in place.
- SidebarMenu / SidebarMenuItem
- Native ul / li props.
- useSidebar()
- state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar.
- ParticipantSidebarFooter
- Required callbacks: onWishProfilesSelect, onServicesSelect, onKnowledgeSelect. Optional activeItem: wish | services | knowledge.
ProjectSidebar
<ProjectSidebar projects={projects} onProjectSelect={setProjectId} footer={footer} />- projects
- Records with id, name, and subtitle. The expanded project view uses a clipboard tile and subtitle.
- selectedProjectId / onProjectSelect
- Selection is controlled; the callback receives a project ID. The sidebar collapses to an icon rail through SidebarProvider.
- footer
- Shared footer actions anchored to the bottom in both expanded and collapsed states.
Sidebar - Knowledge Base (KnowledgeBaseSidebar)
import { KnowledgeBaseSidebar } from '@wafm/ui/components/knowledge-base-sidebar'
<SidebarProvider>
<SidebarProvider open={false} mobile={false} className="w-auto shrink-0 border-r">
<ProjectSidebar projects={projects} onProjectSelect={selectProject} footer={footer} />
</SidebarProvider>
<KnowledgeBaseSidebar
title="Diagnostik-Wissen"
groups={groups}
query={query}
onQueryChange={setQuery}
selectedItemId={articleId}
onItemSelect={selectArticle}
/>
<main>{articlePreview}</main>
</SidebarProvider>- title
- Static header with a knowledge-base icon. No back action or version picker.
- groups
- Groups with a label and items containing id and label.
- query / onQueryChange
- Controlled search; matches item and group labels, with an empty-result message.
- selectedItemId / onItemSelect
- Controlled article selection. The component does not fetch article content.
- Composition
- Secondary navigation, 256px wide, composed beside the 48px collapsed main sidebar. The app supplies the main sidebar separately. The knowledge sidebar uses its own provider for the mobile Sheet and does not own routing.
Figma properties
Properties for the supported sidebar layouts and their nested components. The knowledge-base layout uses its descriptive name; other Figma property names are preserved.
- Sidebar Menu Top
- Property 1: Expanded | Collapsed.
- SidebarGroupLabel
- Label (text). Type: Default | Collapsible | Action. State: Default | Hover. Text Size: sm | xs.
- MediaAsset
- Type: Avatar | Icon.
- SidebarGroup
- Label (boolean), Items (slot). Collapsed: False | True.
- SidebarMenuItem
- Submenu: False | True.
- Input
- Placeholder Text (text). Variant: Default | File | Password. State: Default | Focus | Filled | Disabled | Invalid | Invalid (Filled).
- Select Attendee
- Attendee: 1–8 (stable participant colors). State: hover | Active | Default. Hover reveals a half-opacity color dot; selection makes the dot opaque.
- Select Attendee Muted
- Mutef (boolean). Muted: true | false. Muted rows are shown when comparison capacity is reached.
- 06-16 Sidebar
- Supported layouts: Einzel | Projekt Ebene | Vergelich | Sidebar - Knowledge Base. collaped: true | false for project and participant sidebars; the knowledge base stays expanded beside the main sidebar.
- SidebarMenuButton
- Text (text); Badge Text (text); Icon, Dropdown, Subtitle, 2nd Icon (booleans); Subtitle Text (text); Media (instance swap). Type: Simple | Collapsible | Dropdown | Tree | Badge | Big Icon | Checkbox. State: Default | Hover | Active | Focused. Collapsed: False | True.
- CollapseIcon
- Type: Vertical | Up Down | Horizontal | Plus Minus. Active: No | Yes.
- IconPlaceholder
- Phosphor Icon, Custom icons (instance swaps).
- Phosphor icons
- CaretUpDown, ClipboardText, PencilSimple, UserFocus, User, Users, HeadCircuit, AddressBookTabs: Format = Stroke; Weight = Duotone | Fill | Regular.
- Wunsch Sidbar Item
- Property 1: Default | Hover-active | Active | hover.
- Tabs
- Property 1: Vergleich | Einzel.
- Tabs / Trigger
- Tab Text (text); Show Icon, Badge (booleans). Variant: Default | Line. Active: Off | On. State: Default | Hover | Focus | Disabled.
- Attendee List (8)
- Property 1: Default (no selection) | Variant2–Variant9 (participants 1–8 selected respectively).
- Singel Attendee
- State: Default | active | hover.
- Normal attendy menu item
- Mutef (boolean). State: default | active | hover.
- Bottom Menu Sidebar
- Property 1: Expanded | collapsed.
- Menu Strong
- Slot#818:0, Slot#929:0 (slots). Vergelichen: false. Mode: active | default | hover.
Design gaps
No blocker for this playground. These are the remaining design and application integration boundaries.
- Supported layouts are projects and single/comparison participants in expanded or collapsed states, plus Sidebar - Knowledge Base. The attendee-list variants map to no selection and participants 1–8.
- Sidebar - Knowledge Base is secondary navigation beside the collapsed main sidebar. Its header is a static icon and title, and its expanded control is locked. The original label “Hinseise” is preserved in the knowledge menu. Mutef remains an internal Figma property name rather than a public React prop.
- The nested design export returned collapsed markup with an expanded screenshot. Direct master-component inspection confirms the expanded and comparison layouts used here.
- No mobile layout is defined in the inspected variants. The foundation uses the shadcn Sheet pattern below 768px. The playground also switches to the Sheet in frames narrower than 480px. The playground reports clicks, shows picker dropdowns, and filters knowledge topics. In the knowledge-base preview, the main icon rail stays visible while the secondary sidebar opens in a Sheet. Wish-profile edit only opens a preview notice. The app supplies destination pages and persisted selection.
- The sidebar inherits the application's system font and uses the shared semantic tokens. This foundation keeps the sidebar in document flow and exposes the subset of shadcn primitives needed here.