# RandomCodeSpace Design System — Full reference > Every component with its prop signature and one canonical example. Auto-generated from src/components.ts on every Pages build. Package: `@ossrandom/design-system` (npm) · `@randomcodespace/design-system` (GitHub Packages) Live docs: https://randomcodespace.github.io/design-system/docs/ ## Boilerplate ```tsx import { ThemeProvider, ToastRegion } from "@ossrandom/design-system"; import "@ossrandom/design-system/styles.css"; function App() { return ( {/* your UI */} ); } ``` ## Tokens - **BrandColor** = | "signal-red" // #E60000 — primary action, live state, errors | "signal-red-700" // #B30000 | "signal-red-900" // #9E0000 | "cod-gray" // #1C1C1C — primary text, ink | "cod-gray-700" // #3D3D3D | "cod-gray-500" // #5A5A5A — secondary text | "cod-gray-300" // #A6A6A6 — tertiary, disabled | "cod-gray-100" // #F5F5F5 — surface | "cod-gray-050" // #FAFAFA | "white" - **SemanticColor** = | "success" // green-ish via signal-red? we use mono — runtime cod-gray w/ filled dot | "warning" // #D98E2B | "danger" // signal-red | "info" // cod-gray | "neutral" - **ThemeMode** = "light" | "dark" - **SpaceSize** = "xs" | "sm" | "md" | "lg" | "xl" | number - **Radius** = "none" | "sm" | "md" | "lg" | "pill" | "circle" | number - **Shadow** = "none" | "sm" | "md" | "lg" | "overlay" - **FontFamily** = "sans" | "mono" - **FontWeight** = 400 | 500 | 600 | 700 - **TypeScale** = | "display-xl" | "display-lg" | "display-md" | "h1" | "h2" | "h3" | "h4" | "body-lg" | "body-md" | "body-sm" | "caption" | "overline" | "code" - **Size** = "xs" | "sm" | "md" | "lg" - **Density** = "comfortable" | "default" | "compact" - **Direction** = "horizontal" | "vertical" - **Axis** = "x" | "y" | "both" - **Align** = "start" | "center" | "end" | "baseline" | "stretch" - **Justify** = "start" | "center" | "end" | "between" | "around" | "evenly" ## Theme ### ThemeProvider Source: `src/components/theme.tsx` · component Import: `import { ThemeProvider } from "@ossrandom/design-system";` Props: - `mode?: ThemeMode` - `accent?: BrandColor` - `fontFamily?: { readonly sans: string; readonly mono: string }` - `children: ReactNode` (required) Example: ```tsx (() => { function Demo() { const { mode, toggle } = useTheme(); return {mode} ; } return ; })() ``` Docs: https://randomcodespace.github.io/design-system/docs/ThemeProvider/ ### useTheme Source: `src/components/theme.tsx` · hook Import: `import { useTheme } from "@ossrandom/design-system";` Returns the current theme context: `{ mode, setMode, toggle }`. Example: ```tsx (() => { function Demo() { const { mode, toggle } = useTheme(); return {mode} ; } return ; })() ``` Docs: https://randomcodespace.github.io/design-system/docs/useTheme/ ## Layout ### Card Source: `src/components/layout.tsx` · component Import: `import { Card } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `title?: ReactNode` - `subtitle?: ReactNode` - `extra?: ReactNode` - `footer?: ReactNode` - `bordered?: boolean` - `hoverable?: boolean` - `padding?: SpaceSize` - `radius?: Radius` - `shadow?: Shadow` - `children?: ReactNode` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/Card/ ### Space Source: `src/components/layout.tsx` · component Import: `import { Space } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `direction?: Direction` - `size?: SpaceSize` - `align?: Align` - `justify?: Justify` - `wrap?: boolean` - `split?: ReactNode` - `children: ReactNode` (required) Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/Space/ ### ScrollDiv Source: `src/components/layout.tsx` · component Import: `import { ScrollDiv } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `direction?: Axis` - `height?: number | string` - `maxHeight?: number | string` - `width?: number | string` - `shadow?: boolean` - `contain?: boolean` - `thin?: boolean` - `children: ReactNode` (required) - `onScroll?: (state: { scrollTop: number; scrollLeft: number; atTop: boolean; atBottom: boolean }) => void;` Example: ```tsx

Scrollable content.

More content.

Keep going.

Done.

``` Docs: https://randomcodespace.github.io/design-system/docs/ScrollDiv/ ### Divider Source: `src/components/layout.tsx` · component Import: `import { Divider } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `direction?: Direction` - `children?: ReactNode` - `variant?: "solid" | "dashed"` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/Divider/ ### Grid Source: `src/components/layout.tsx` · component Import: `import { Grid } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `columns?: number` - `gap?: SpaceSize` - `children: ReactNode` (required) Example: ```tsx One Two Three ``` Docs: https://randomcodespace.github.io/design-system/docs/Grid/ ### PageHeader Source: `src/components/page.tsx` · component Import: `import { PageHeader } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `title: ReactNode` (required) - `subtitle?: ReactNode` - `breadcrumbs?: BreadcrumbProps["items"]` - `tabs?: TabsProps["items"]` - `actions?: ReactNode` - `badge?: ReactNode` - `avatar?: ReactNode` - `back?: { readonly label?: string; readonly onClick: () => void }; readonly size?: "xs" | "sm" | "md" | "lg" | "xl"; readonly inlineSubtitle?: boolean; readonly backInline?: boolean;` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/PageHeader/ ### AppShell Source: `src/components/page.tsx` · component Import: `import { AppShell } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `header?: ReactNode` - `sidebar?: ReactNode` - `footer?: ReactNode` - `sidebarWidth?: number` - `sidebarCollapsible?: boolean` - `children: ReactNode` (required) Example: ```tsx
Main content
``` Docs: https://randomcodespace.github.io/design-system/docs/AppShell/ ## Buttons & actions ### Button Source: `src/components/buttons.tsx` · component Import: `import { Button } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `variant?: ButtonVariant` - `size?: Size` - `shape?: ButtonShape` - `loading?: boolean` - `disabled?: boolean` - `block?: boolean` - `iconLeft?: ReactNode` - `iconRight?: ReactNode` - `type?: "button" | "submit" | "reset"` - `children?: ReactNode` - `onClick?: (e: MouseEvent) => void;` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/ButtonGroup/ ## Forms & inputs ### Input Source: `src/components/inputs.tsx` · component Import: `import { Input } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `value?: string` - `defaultValue?: string` - `placeholder?: string` - `size?: Size` - `status?: InputStatus` - `disabled?: boolean` - `readOnly?: boolean` - `invalid?: boolean` - `prefix?: ReactNode` - `suffix?: ReactNode` - `clearable?: boolean` - `type?: "text" | "email" | "password" | "url" | "search" | "tel"` - `autoFocus?: boolean` - `onChange?: (value: string, e: ChangeEvent) => void; readonly onFocus?: (e: FocusEvent) => void; readonly onBlur?: (e: FocusEvent) => void; readonly onKeyDown?: (e: KeyboardEvent) => void;` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/Input/ ### NumberInput Source: `src/components/inputs.tsx` · component Import: `import { NumberInput } from "@ossrandom/design-system";` Extends: `Omit` Props: - `value?: number` - `defaultValue?: number` - `min?: number` - `max?: number` - `step?: number` - `precision?: number` - `onChange?: (value: number) => void;` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/NumberInput/ ### PinInput Source: `src/components/inputs.tsx` · component Import: `import { PinInput } from "@ossrandom/design-system";` Extends: `BaseProps` Props: - `length: 4 | 6 | 8` (required) - `value?: string` - `mask?: boolean` - `autoFocus?: boolean` - `placeholder?: string` - `onChange?: (value: string) => void; readonly onComplete?: (value: string) => void;` Example: ```tsx ``` Docs: https://randomcodespace.github.io/design-system/docs/PinInput/ ### Textarea Source: `src/components/inputs.tsx` · component Import: `import { Textarea } from "@ossrandom/design-system";` Extends: `Omit` Props: - `rows?: number` - `autoResize?: boolean` - `maxLength?: number` - `showCount?: boolean` Example: ```tsx