@arkyn/components is the React UI layer of Arkyn. It provides ready-to-use components, client-side hooks, context providers, and a few utility helpers that work together to build consistent interfaces with less boilerplate.@arkyn/components?useModal, useDrawer, useToast, and useForm connect UI with shared application state.ClientOnly and useHydrated help avoid hydration mismatches in mixed server/client rendering.toHtml and toRichTextValue convert between editor models and HTML.bash
bun add @arkyn/components
@react-google-maps/api or mapbox-gl for map components like MapView/SearchPlaces, is-hotkey and slate/slate-history/slate-react for the rich text editor, react-scroll for scroll-based automation (e.g. useAutomation), and react-hot-toast for toast notifications. You don't need to install these unless you use the components that require them, but if you want to avoid runtime errors, you can install all of them at once:bash
bun add @react-input/mask html-react-parser lucide-react react react-dom react-hot-toast
main.tsx, index.tsx, root.tsx or App.tsx), import the component styles:tsx
import "@arkyn/components/styles";
@arkyn/components/button.css:tsx
import "@arkyn/components/button.css";import "@arkyn/components/modalContainer.css";
modalContainer.css also contains the styles it needs from any components ModalContainer uses under the hood), so you don't need to chase down internal dependencies manually.@arkyn/components/styles import when you use many components across your app, or when several of the components you use share internals, importing each one's .css file separately in that case can end up duplicating the shared styles. Prefer the per-component .css imports when you only use a small, distinct set of components and want to avoid shipping CSS for the rest of the library.globals.css, app.css or variables.css) and redeclare the variables you want to change:css
:root {--white: #ffffff;/* background */--background: #f4f4f5;--background-underground: #fafafa;--background-foreground: #ffffff;/* text */--text-heading: #09090b;--text-body: #52525b;--text-muted: #a1a1aa;/* border */--border: #e2e8f0;/* inputs, textarea, select, checkbox, etc. */--input-background: #fafafa;/* tooltip */--tooltip-text: #fafafa;--tooltip-background: #27272a;/* spotlight */--spotlight-primary: 17, 109, 220; /* #116ddc */--spotlight-secondary: 100, 116, 139; /* #64748B */--spotlight-success: 16, 185, 129; /* #10b981 */--spotlight-danger: 244, 63, 94; /* #f43f5e */--spotlight-info: 14, 165, 233; /* #0ea5e9 */--spotlight-warning: 249, 115, 22; /* #f97316 */--spotlight-primary-foreground: 231, 240, 252; /* #E7F0FC */--spotlight-secondary-foreground: 250, 250, 250; /* #fafafa */--spotlight-success-foreground: 231, 248, 242; /* #E7F8F2 */--spotlight-danger-foreground: 254, 236, 239; /* #FEECEF */--spotlight-info-foreground: 231, 246, 253; /* #E7F6FD */--spotlight-warning-foreground: 254, 241, 232; /* #FEF1E8 */}
@arkyn/components and its required peer dependencies.@arkyn/components ships its own AGENTS.md file inside the published package (available at node_modules/@arkyn/components/AGENTS.md after install), a reference written specifically for AI coding assistants like Claude Code, Cursor, or Copilot. It documents every component, hook, and provider's exact props, import path, and behavior, so your assistant doesn't need to read the source to use the library correctly.@arkyn/cli once in your project to link it in:bash
npx @arkyn/cli init --agents
AGENTS.md pointing at @arkyn/components' bundled docs (and those of any other installed @arkyn/* package). Rerun it whenever you add or remove Arkyn packages. See the @arkyn/cli introduction for details.