d16a94324be9e495d8ff07ae3c98adcd17033d4b
@collabry/components
React + Tailwind CSS component library for the Collabry UI, built on shadcn/ui (Radix UI, cmdk, Sonner), with a Storybook catalogue.
npm install
npm run storybook # http://localhost:6006
npm run build # library → dist/ (ESM, types, collabry.css)
npm run build-storybook # static Storybook → storybook-static/
npm run typecheck
Use in an app
import { ThemeProvider, Button, Toaster } from '@collabry/components';
import '@collabry/components/styles.css';
import '@fontsource/lato/400.css';
import '@fontsource/lato/700.css';
import '@fontsource/lato/900.css';
<ThemeProvider theme="dark" accent="#6A5FCB" tint="off" className="min-h-screen bg-app">
<Button variant="primary">Neue Aufgabe</Button>
<Toaster /> {/* once, if you use toast() */}
</ThemeProvider>;
react, react-dom are peer dependencies; radix-ui, cmdk, sonner, class-variance-authority, lucide-react, clsx and tailwind-merge are installed with the package.
Dialogs, menus and popovers portal into the nearest ThemeProvider element, so they keep its theme, accent and tint.
Structure
src/styles/tokens.css: design tokens (--cl-*) for dark and light, with accent and tint derived viacolor-mixsrc/styles/index.css: Tailwind v4 theme mapping tokens to utilities (bg-surface,text-fg-muted,border-line, …)src/components/ui/: shadcn/ui primitives (components.json), restyled to the Collabry tokens. Accessibility, focus and keyboard handling come from Radix / cmdk.src/components/<Name>/<Name>.tsx+<Name>.stories.tsx: Collabry components composed fromui/src/stories/: introduction, token overview and sample data from the design
Components
| Area | Components |
|---|---|
| Grundlagen | ThemeProvider, Button, ButtonLink, Card, CardHeader, CardFooter, PageHeader, EmptyState, Spinner, Logo |
| Formulare | Field, Input, PasswordInput, Textarea, Select, Checkbox, TaskCheckbox, SegmentedControl |
| Anzeige | StatusBadge, CountBadge, RoleBadge, Swatch, Kbd, Avatar, AvatarStack, ProgressBar, StatusProgress |
| Overlays | Menu, Dialog, Drawer, Toast, Toaster, toast(), CommandPalette, SearchTrigger, NotificationPanel, NotificationItem |
| Navigation | Sidebar, NavItem, UserMenu, MobileHeader, MobileTabBar, SettingsNav |
| Aufgaben | TaskTable, TaskRow, TaskSectionHeader, PriorityLabel, DeadlineItem, DateTile, CommentItem, CommentComposer |
| Gruppen | GroupCard, GroupRow, NewGroupTile, InviteBanner |
| Kalender | CalendarMonth, CalendarToolbar, CalendarLegend, GroupFilterChip, DayEventItem |
| Einstellungen | SettingsSection, SettingsRow, ThemePicker, ColorSchemePicker, SaveStatus |
| Anmeldung | AuthBrandPanel, FeatureItem, PasswordRules |
Adding shadcn/ui components
npx shadcn@latest add <component>
npm uninstall cn
Then, in the new src/components/ui/<component>.tsx:
- change
import { cn } from "cn"toimport { cn } from "@/lib/cn"(the registry now imports shadcn'scnpackage; ours knows the custom text and shadow scales) - pass
container={usePortalContainer()}(from@/lib/portal) to every*.Portal - shadcn token names (
bg-popover,text-muted-foreground,border-border, …) map to Collabry colors, exceptaccent, which is the brand color here: replacefocus:bg-accent/hover:bg-accentwithbg-hover-menu - the
animate-in/fade-in-0/zoom-in-95classes needtw-animate-css, which is not installed; usedata-[state=open]:animate-panel-ininstead
Languages
TypeScript
93.1%
CSS
6.1%
MDX
0.7%