### Install registry items Source: https://tuiparts.sh/docs/registry Commands to install items using either a namespace or a direct URL. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox ``` ```bash pnpm dlx shadcn@4.13.0 add https://tuiparts.sh/r/react/checkbox.json ``` -------------------------------- ### Install Checkbox Source: https://tuiparts.sh/docs/catalog/checkbox Installation commands for different framework implementations. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/checkbox ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/checkbox ``` -------------------------------- ### Install and register a theme preset Source: https://tuiparts.sh/docs/theming Install a preset via the CLI and register it within the application to activate it. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/theme-catppuccin ``` ```ts import { theme } from "./components/ui/theme"; import { catppuccin } from "./themes/catppuccin"; theme.register("catppuccin", catppuccin); theme.setActive("catppuccin"); ``` -------------------------------- ### Install Toggle package Source: https://tuiparts.sh/docs/catalog/toggle Install the Toggle component for the desired framework using the shadcn CLI. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/toggle ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/toggle ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/toggle ``` -------------------------------- ### Define item addresses Source: https://tuiparts.sh/docs/registry Examples of runtime-specific Recipe addresses used for installation. ```text core/checkbox react/checkbox solid/checkbox ``` -------------------------------- ### Install Dialog components Source: https://tuiparts.sh/docs/catalog/dialog Use the shadcn CLI to add the Dialog component to your project. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/dialog ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/dialog ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/dialog ``` -------------------------------- ### Install Checkbox Recipe Source: https://tuiparts.sh/docs/quickstart Use the shadcn CLI to add the checkbox recipe to your project. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox ``` -------------------------------- ### Install Button components Source: https://tuiparts.sh/docs/catalog/button Use the shadcn CLI to add the Button component for your specific framework. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/button ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/button ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/button ``` -------------------------------- ### Install Tabs package Source: https://tuiparts.sh/docs/catalog/tabs Use the CLI to add the Tabs component to your project. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/tabs ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/tabs ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/tabs ``` -------------------------------- ### Install Input components Source: https://tuiparts.sh/docs/catalog/input Commands to add the Input component for different frameworks using the shadcn CLI. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/input ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/input ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/input ``` -------------------------------- ### Install Switch components Source: https://tuiparts.sh/docs/catalog/switch Commands to add the Switch component to React, Solid, or Core projects. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/switch ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/switch ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/switch ``` -------------------------------- ### Install Accordion packages Source: https://tuiparts.sh/docs/catalog/accordion Use the shadcn CLI to add the Accordion component for your specific framework. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/accordion ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/accordion ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/accordion ``` -------------------------------- ### Use Checkbox in Core Source: https://tuiparts.sh/docs/catalog/checkbox Implementation example for the Core library. ```ts import { createCheckbox } from "./components/ui/checkbox"; const checkbox = createCheckbox(ctx, { label: "Enable notifications", defaultChecked: true, onCheckedChange: (checked) => console.log({ checked }), }); parent.add(checkbox); ``` -------------------------------- ### Use Checkbox in React and Solid Source: https://tuiparts.sh/docs/catalog/checkbox Implementation example for React and Solid frameworks. ```tsx import { Checkbox } from "./components/ui/checkbox"; console.log({ checked })} />; ``` -------------------------------- ### Install Number Field Source: https://tuiparts.sh/docs/catalog/number-field Install the Number Field component for React, Solid, or Core using the shadcn CLI. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/number-field ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/number-field ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/number-field ``` -------------------------------- ### Install Collapsible Source: https://tuiparts.sh/docs/catalog/collapsible Commands to add the Collapsible component to your project using the shadcn CLI. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/collapsible ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/collapsible ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/collapsible ``` -------------------------------- ### Install Radio Group Source: https://tuiparts.sh/docs/catalog/radio-group Use the shadcn CLI to add the Radio Group component to your project. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/radio-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/radio-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/radio-group ``` -------------------------------- ### Install Badge components Source: https://tuiparts.sh/docs/catalog/badge Use the shadcn CLI to add the Badge recipe to your project for React, Solid, or Core. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/badge ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/badge ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/badge ``` -------------------------------- ### Install OpenTUI Primitive packages Source: https://tuiparts.sh/docs/primitives Use these commands to add the necessary Primitive package to your existing OpenTUI project. ```bash pnpm add @tuiparts/react ``` ```bash pnpm add @tuiparts/solid ``` ```bash pnpm add @tuiparts/core ``` -------------------------------- ### Install Textarea components Source: https://tuiparts.sh/docs/catalog/textarea Commands to add the Textarea component to React, Solid, or Core projects using the shadcn CLI. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/textarea ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/textarea ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/textarea ``` -------------------------------- ### Install Toggle Group packages Source: https://tuiparts.sh/docs/catalog/toggle-group Use the shadcn CLI to add the Toggle Group component for React, Solid, or Core. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/toggle-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/toggle-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/toggle-group ``` -------------------------------- ### Review and update registry items Source: https://tuiparts.sh/docs/registry Commands to check for updates, view changes, or perform a dry run of an installation. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox --view pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox --diff pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox --dry-run ``` -------------------------------- ### Install Checkbox Group Source: https://tuiparts.sh/docs/catalog/checkbox-group Commands to add the Checkbox Group component to your project using shadcn. ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/react/checkbox-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/solid/checkbox-group ``` ```bash pnpm dlx shadcn@4.13.0 add @tuiparts/core/checkbox-group ``` -------------------------------- ### Implement a Checkbox component Source: https://tuiparts.sh/ Example of using the Checkbox primitive in a React application. ```typescript import { Checkbox as CheckboxPrimitive } from "@tuiparts/react/checkbox"; export function Checkbox() { return ( {(state) => ( <> )} ); } ``` -------------------------------- ### Compose the Radio Group primitive Source: https://tuiparts.sh/docs/primitives/radio-group Examples of implementing a Radio Group in React, Solid, and Core frameworks. ```tsx import { Radio } from "@tuiparts/react/radio"; import { RadioGroup } from "@tuiparts/react/radio-group"; {[ ["dark", "Dark"], ["light", "Light"], ["system", "System"], ].map(([value, label]) => ( ))} ; ``` ```tsx import { Radio } from "@tuiparts/solid/radio"; import { RadioGroup } from "@tuiparts/solid/radio-group"; ; ``` ```ts import { TextRenderable } from "@opentui/core"; import { RadioGroupRenderable } from "@tuiparts/core/radio-group"; import { RadioIndicatorRenderable, RadioRootRenderable, } from "@tuiparts/core/radio"; const group = new RadioGroupRenderable(ctx, { defaultValue: "dark", gap: 1 }); for (const value of ["dark", "light"]) { const radio = new RadioRootRenderable(ctx, { store: group.store, value }); const indicator = new RadioIndicatorRenderable(ctx, { radio }); indicator.add(new TextRenderable(ctx, { content: "●" })); radio.add(indicator); radio.add(new TextRenderable(ctx, { content: value })); group.add(radio); } parent.add(group); ``` -------------------------------- ### Compose Checkbox Group Source: https://tuiparts.sh/docs/primitives/checkbox-group Examples of implementing a grouped checkbox structure across different frameworks. ```tsx import { Checkbox } from "@tuiparts/react/checkbox"; import { CheckboxGroup } from "@tuiparts/react/checkbox-group"; {[ ["email", "Email notifications"], ["sms", "SMS notifications"], ].map(([value, label]) => ( ))} ; ``` ```tsx import { Checkbox } from "@tuiparts/solid/checkbox"; import { CheckboxGroup } from "@tuiparts/solid/checkbox-group"; ; ``` ```ts import { TextRenderable } from "@opentui/core"; import { CheckboxIndicatorRenderable, CheckboxRootRenderable, } from "@tuiparts/core/checkbox"; import { CheckboxGroupRenderable } from "@tuiparts/core/checkbox-group"; const group = new CheckboxGroupRenderable(ctx, { defaultValue: ["email"], flexDirection: "column", gap: 1, }); const email = new CheckboxRootRenderable(ctx, { group: group.store, value: "email", }); const indicator = new CheckboxIndicatorRenderable(ctx, { store: email.store, }); indicator.add(new TextRenderable(ctx, { content: "✓" })); email.add(indicator); email.add(new TextRenderable(ctx, { content: "Email notifications" })); group.add(email); parent.add(group); ``` -------------------------------- ### Use Dialog in React and Solid Source: https://tuiparts.sh/docs/catalog/dialog Import the Dialog components and compose them within the Dialog root. ```tsx import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, } from "./components/ui/dialog"; ; ``` -------------------------------- ### theme.follow(renderer) Source: https://tuiparts.sh/docs/theming Synchronizes theme with the renderer's terminal color mode. ```APIDOC ### theme.follow(renderer) Configures the theme to follow the specified renderer's terminal color mode. ``` -------------------------------- ### Use Input in Core Source: https://tuiparts.sh/docs/catalog/input Use the createInput function to create an input renderable in the Core framework. ```ts import { createInput } from "./components/ui/input"; const input = createInput(ctx, { placeholder: "Search Recipes…", onInput: (value) => setQuery(value), onSubmit: (value) => search(value), }); parent.add(input); ``` -------------------------------- ### Use Badge in Core Source: https://tuiparts.sh/docs/catalog/badge Use the createBadge factory to generate a BoxRenderable, then add it to the parent container. ```ts import { createBadge } from "./components/ui/badge"; const status = createBadge(ctx, { label: "Passing", intent: "success", }); parent.add(status); ``` -------------------------------- ### Use Textarea in React and Solid Source: https://tuiparts.sh/docs/catalog/textarea Basic implementation of the Textarea component with initial value and submission handling. ```tsx import { Textarea } from "./components/ui/textarea";