The Coline design system: accessible React components for Coline Apps, themed live by the host workspace, and for Coline Sites in light and dark. Tailwind v4 stylesheet included. MIT.
| ## Required app setup |
| 8 |
| 9 | ```tsx |
| 10 | import { createRoot } from "react-dom/client"; |
| 11 | import { |
| 12 | Button, |
| 13 | ColineAppProvider, |
| 14 | useColine, |
| 15 | useColineQuery, |
| 16 | } from "@colineapp/ui"; |
| 17 | import "@colineapp/ui/styles.css"; |
| 18 |
| 19 | function Home() { |
| 20 | const coline = useColine(); |
| 21 | const items = useColineQuery( |
| 22 | (capabilities) => capabilities.files.list({ limit: 100 }), |
| 23 | [], |
| 24 | ); |
| 25 | return <Button onClick={() => items.refetch()}>Refresh</Button>; |
| 26 | } |
| 27 |
| 28 | const root = document.getElementById("root"); |
| 29 | if (root) { |
| 30 | createRoot(root).render( |
| 31 | <ColineAppProvider> |
| 32 | <Home /> |
| 33 | </ColineAppProvider>, |
| 34 | ); |
| 35 | } |
| 36 | ``` |
| 37 |
| 38 | The package requires React 19 and ReactDOM 19 as peer dependencies. The |
| 39 | scaffold installs them for app authors. `ColineAppProvider` is mandatory |
| 40 | before using `useColine`, `useColineContext`, `useColineQuery`, or |
| 41 | `useColorScheme`; it intentionally renders nothing until the bridge connects. |
| 42 |
| 43 | ## Data and sandbox rules |
| 44 |
| 45 | - All app data goes through the injected `coline.*` capability client. |
| 46 | - Do not use `fetch`, localStorage, cookies, direct API routes, or credentials |
| 47 | in a sandboxed app. Network access belongs behind `coline.net.fetch` and the |
| 48 | manifest allowlist. |
| 49 | - `useColineQuery(loader, deps)` is a small loading/error/refetch helper, not a |
| 50 | cache. Keep loaders bounded and put stable values in `deps`. |
| 51 | - Use host theme tokens and the exported components. Do not hardcode light-only |
| 52 | colors or invent a second provider. |
| 53 |
| 54 | ## Component contract |
| 55 |
| 56 | The public barrel exports the provider/hooks plus accessible components such |
| 57 | as `Button`, `Card`, `Input`, `Textarea`, `Badge`, `Dialog`, `Select`, |
| 58 | `Checkbox`, `Switch`, `Tabs`, `Table`, `Skeleton`, and `Tooltip`. Check the |
| 59 | component source and declaration output before documenting a new prop. |
| 60 |
| 61 | The client bundle is built by Coline. The app submits `main.tsx` and its |
| 62 | source files; it does not submit `node_modules` or install packages in the |
| 63 | sandbox. Keep client imports limited to the scaffold dependencies and app |
| 64 | source. |
| 65 |
| 66 | ## Verification and release |
| 67 |
| 68 | - Run `pnpm --filter @colineapp/ui typecheck` after component/provider changes. |
| 69 | - Keep CSS export and component export changes together. |
| 70 | - Preserve React peer dependency ranges and the `./styles.css` export. |
| 71 | - Update README examples and the scaffold skill when an app-facing contract |
| 72 | changes. The generated app must be able to use the documented API after a |
| 73 | clean `npm install`. |
| 74 |