# Solid UI: full documentation > The text of every page listed in https://www.solid-ui.com/llms.txt, as Markdown. Examples and component sources appear as `[Example: name]` and `[Source: path]`. The Markdown at each page's Source URL has their code. # Introduction Source: https://www.solid-ui.com/docs.md > Accessible components for Solid 2.0, built with UI SDK and Tailwind CSS. Take the source and make it your own. Solid UI is an unofficial Solid 2.0 port of [shadcn/ui](https://ui.shadcn.com/). **Build your own component library with code you control.** With a packaged component library, you install a dependency and import its components. As your design system grows, you may need to add wrappers, override styles, or mix components with different APIs. Solid UI gives you the component source so you can make those changes in your own codebase. Solid UI is built around five principles. - **Open Code.** Copy the component source into your project and edit it there. - **Composition.** Combine explicit component parts to build the interface you need. - **Distribution.** Find the source files and dependencies together in the component registry. - **Beautiful Defaults.** Start with accessible components and styles that work together. - **AI-Ready.** Give coding tools source files and examples they can inspect and edit. ## Open Code Solid UI hands you the source for each component. You can see how it renders, use it as a starting point, and change its styling or behavior alongside the rest of your app. For a concrete example, try editing your local copy of [Button](/docs/components/button/). How do upstream updates work? Update UI SDK to receive fixes to the behaviors your components use, such as focus management and keyboard navigation. For changes to Solid UI's component source, compare the updated source with your local copy and merge the changes you want to keep. ## Composition Components expose named parts you can assemble. UI SDK connects those parts and manages interactions like focus and dismissal. For example, you can combine a trigger, content, a title, and an optional description in [Dialog](/docs/components/dialog/). ## Distribution The registry records the source and dependencies behind each component. The **Manual** installation tab shows the source for the selected style and the dependencies it needs. Try it from any page in the [component catalog](/docs/components/). ## Beautiful Defaults The components share a visual language so you can combine them in a form, menu, or page. Try the style selector to compare the available presets in light and dark mode. Tailwind CSS classes and shared color tokens give you a starting point for your own design system. ## Shared Styles `init` writes `solid-ui.css` from your preset: the theme tokens, fonts, dark mode and the shared utilities the components use, such as state variants, accordion animations, scroll fades and text shimmer. Run it again with `--force` to switch the preset, see [Switch the theme](/docs/cli/#switch-the-theme). To set it up by hand, install the packages the stylesheet imports, save it next to your app stylesheet and import it right after Tailwind CSS. `@layer ui-sdk` comes first, so your styles and Tailwind utilities override UI SDK's own CSS. ```css title="src/App.css" @layer ui-sdk; @import "tailwindcss"; @import "./solid-ui.css"; ``` The stylesheet below uses the Nova preset. For another one, build it on the [Create](/create) page and run `init` with its code. ## AI-Ready Coding tools can read the same component files you edit. Point them to an existing component and its examples when you want to build a new variation. Named parts and shared styling patterns give the tool concrete conventions to follow. The docs are written for coding tools too. [llms.txt](/llms.txt) lists every page with a short description, and [llms-full.txt](/llms-full.txt) has the text of all of them in one file. Add `.md` to a docs URL, such as [/docs/components/button.md](/docs/components/button.md), to get that page as Markdown with the source of its examples. # Installation Source: https://www.solid-ui.com/docs/installation.md > How to install dependencies and structure your app. ## Built for Solid 2.0 ## Choose Your Framework
Vite

Vite

# CLI Source: https://www.solid-ui.com/docs/cli.md > Use solidui-cli to set up Solid UI and add components to your project. ## init Use `init` to set up Solid UI in a Solid 2 project. It writes `components.json`, the theme in `solid-ui.css` and the `cn` helper, wires up the `~/` alias and installs the shared packages. ```bash npx solidui-cli@latest init ``` **Options** ```txt Usage: solidui-cli init [options] Options: -c, --cwd the project directory (default: current directory) -p, --preset a preset code from solid-ui.com/create -y, --yes skip the prompts and use the defaults -f, --force replace an existing components.json and solid-ui.css --css the app stylesheet that imports Tailwind CSS --alias the import alias for the components (default: ~) -h, --help display help for command ``` ## add Use `add` to copy components into your project and install what they need. Without names, it lets you pick from the catalog. ```bash npx solidui-cli@latest add [components...] ``` **Options** ```txt Usage: solidui-cli add [options] [components...] Options: -c, --cwd the project directory (default: current directory) -o, --overwrite replace files that differ -y, --yes skip the prompts; keep files that differ -a, --all add every component -h, --help display help for command ``` ## Examples ### Skip the prompts In CI, scripts or coding agents, pass `--yes` together with the preset: ```bash npx solidui-cli@latest init --preset --yes ``` Without `--preset` and `--alias`, `--yes` uses the Nova preset and the `~` alias. `--yes` never overwrites your files: `init` keeps a changed `lib/utils.ts` and `add` keeps components that differ from the registry. It does update packages the components can't work without, like an older Tailwind CSS minor or another UI SDK beta. Other packages outside the tested ranges stay as they are, with a warning. ### Switch the theme Build a new preset on the [Create](/create) page and run `init` again with `--force`: ```bash npx solidui-cli@latest init --preset --force ``` This replaces only `components.json` and `solid-ui.css` and installs the new fonts, so colors, fonts and radius change everywhere and your components stay untouched. If the new preset also changes the style, for example from Nova to Lyra, components you add from then on use the new style. Re-add the ones you already have with `--overwrite` to switch them too, which replaces your edits to those files. ### Update components `add` never replaces a component you changed. It keeps your copy and tells you which files differ. To take the registry version: ```bash npx solidui-cli@latest add button --overwrite ``` Commit your changes first, then compare the diff and merge back the edits you want to keep. ### Use your package manager Run the CLI with the package manager your project uses, for example `pnpm dlx` or `bunx`. When nothing is installed yet, `init` installs the dependencies with that tool. The solid-v2 templates ship a `pnpm-lock.yaml`, so the lockfile can't tell which tool you chose. Once `node_modules` exists, the CLI keeps using the package manager that installed it, or the one in the `packageManager` field of `package.json`. ### Use another import alias Components import each other through `~/` by default. If your project already uses another prefix such as `@/`, give it when `init` asks, or pass it: ```bash npx solidui-cli@latest init --alias @ ``` `init` saves the aliases in `components.json` and adds `@/*` to `tsconfig.json` unless it's there already. `add` rewrites the imports of every component to match, so `~/lib/utils` arrives as `@/lib/utils`. Running `init` again keeps the aliases from `components.json`. ### Choose the app stylesheet `init` imports `solid-ui.css` into the stylesheet that imports Tailwind CSS. If more than one stylesheet does, name the one your app loads: ```bash npx solidui-cli@latest init --css src/styles/app.css ``` ### Fix unresolved imports Components import each other through the `~/` alias. If Vite reports `Failed to resolve import "~/components/ui/..."`, it isn't reading the alias from `tsconfig.json`. `init` adds the option for you, but it leaves configs it can't edit safely alone, for example one built with `mergeConfig`. Add it yourself: ```ts title="vite.config.ts" export default defineConfig({ resolve: { tsconfigPaths: true }, plugins: [solid(), tailwindcss()] }) ``` ### Unsupported versions `init` stops when `solid-js` or `tailwindcss` is newer than the [tested versions](/docs/installation/#built-for-solid-20). Newer versions ship with a CLI patch release once the components are tested with them, so run `solidui-cli@latest` again later. An older minor within the same major is fine: `init` offers to update it. ### Solid 1 projects Solid UI 1.x needs Solid 2 and Tailwind CSS 4. Projects on Solid 1 and Tailwind CSS 3, or with a `ui.config.json`, keep using the previous registry through version 0.7.2 until they [migrate](/docs/migration/): ```bash npx solidui-cli@0.7.2 add button ``` # Migration Source: https://www.solid-ui.com/docs/migration.md > Move a project from solidui-cli 0.7 on Solid 1 to Solid UI for Solid 2. Projects on Solid 1 keep working with `solidui-cli@0.7.2`, which installs from the previous registry. Migrate when your app moves to Solid 2. ## What changes | Area | solidui-cli 0.7 | Solid UI for Solid 2 | | ------------- | ------------------------------------------------ | -------------------------------------------- | | Framework | Solid 1, SolidStart | Solid 2 with Vite and `@solidjs/vite-plugin` | | Primitives | Kobalte, Corvu, Ark UI, cmdk-solid, solid-sonner | UI SDK, and solid-sonner 1 for Sonner | | Tailwind CSS | 3, with `tailwind.config.cjs` | 4.3 or later, configured in CSS | | Theme | HSL variables in your app stylesheet | Preset tokens in a generated `solid-ui.css` | | Configuration | `ui.config.json` | `components.json` | | Language | TypeScript or JavaScript | TypeScript | | Dark mode | `.dark` or Kobalte's `[data-kb-theme="dark"]` | `.dark` on an ancestor | Your imports keep working: both versions put components in `~/components/ui` and the `cn` helper in `~/lib/utils`. ## Migrate a project ### Upgrade to Solid 2 Follow Solid's [migration guide](https://github.com/solidjs/solid/blob/main/documentation/solid-2.0/MIGRATION.md). Solid UI needs a Vite app with `@solidjs/vite-plugin`; SolidStart projects aren't supported yet. ### Upgrade to Tailwind CSS 4 Run Tailwind's upgrade tool. It moves your `tailwind.config.cjs` into CSS and updates your classes: ```bash npx @tailwindcss/upgrade ``` Then remove what Solid UI 0.7 added to your stylesheet and config: the `:root` and `.dark` blocks with HSL variables such as `--background: 0 0% 100%`, the color, radius and accordion entries that point to them, and `tailwindcss-animate`. The new `solid-ui.css` defines all of them, and the old variables would override it with values that no longer work. Keep your own styles. See Tailwind's [upgrade guide](https://tailwindcss.com/docs/upgrade-guide) for the other changes. ### Run init Delete `ui.config.json` and run `init`: ```bash npx solidui-cli@latest init ``` Pick the preset closest to your old theme, or build one on the [Create](/create) page and pass its code with `--preset`. If you used Kobalte's color mode, toggle the `dark` class on `` instead of `data-kb-theme`. ### Re-add your components Commit your work, then add the components you use again. `--overwrite` replaces the old Kobalte and Corvu versions: ```bash npx solidui-cli@latest add button dialog select --overwrite ``` Compare the diff and merge back your own edits. Components that were renamed or removed are listed [below](#renamed-and-removed-components). ### Update your component usage The components follow UI SDK's API now. Update the places that use the props in [API changes](#api-changes), then check each page in the [components](/docs/components/) docs for its parts. ### Remove the old packages Uninstall the packages Solid UI 0.7 installed and nothing else uses: ```bash npm uninstall @kobalte/core @corvu/drawer @corvu/otp-field @corvu/resizable @ark-ui/solid cmdk-solid solid-sonner embla-carousel-solid chart.js tailwindcss-animate ``` Keep `solid-sonner` if you add [Sonner](/docs/components/sonner/) again. It needs solid-sonner 1 for Solid 2, and `add sonner` offers to upgrade an older version. ## API changes | Previous API | Current API | | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `as={Button}` on primitive parts | `render={(partProps) => ``` ## Composition Use the following composition to build an `Alert`: ```text Alert ├── Icon ├── AlertTitle ├── AlertDescription └── AlertAction ``` ## Basic A basic alert with an icon, title and description. [Example: alert-basic] ## Destructive Use `variant="destructive"` to create a destructive alert. [Example: alert-destructive] ## Action Use `AlertAction` to add a button or other action element to the alert. [Example: alert-action] ## Custom Colors You can customize the alert colors by adding custom classes such as `bg-amber-50 dark:bg-amber-950` to the `Alert` component. [Example: alert-colors] ## API Reference ### Alert The `Alert` component displays a callout for user attention. | Prop | Type | Default | | --------- | ---------------------------- | ----------- | | `variant` | `"default" \| "destructive"` | `"default"` | ### AlertTitle The `AlertTitle` component displays the title of the alert. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### AlertDescription The `AlertDescription` component displays the description or content of the alert. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### AlertAction The `AlertAction` component displays an action element (like a button) positioned absolutely in the top-right corner of the alert. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | # Alert Dialog Source: https://www.solid-ui.com/docs/components/alert-dialog.md > A modal dialog that interrupts the user with important content and expects a response. [Example: alert-dialog-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add alert-dialog ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button ``` Copy and paste the following code into your project. [Source: components/ui/alert-dialog.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "~/components/ui/alert-dialog" ``` ```tsx showLineNumbers Show Dialog Are you absolutely sure? This action cannot be undone. This will permanently delete your account from our servers. Cancel Continue ``` ## Composition Use the following composition to build an `AlertDialog`: ```text AlertDialog ├── AlertDialogTrigger └── AlertDialogContent ├── AlertDialogHeader │ ├── AlertDialogMedia │ ├── AlertDialogTitle │ └── AlertDialogDescription └── AlertDialogFooter ├── AlertDialogCancel └── AlertDialogAction ``` ## Basic A basic alert dialog with a title, description, and cancel and continue buttons. [Example: alert-dialog-basic] ## Small Use the `size="sm"` prop to make the alert dialog smaller. [Example: alert-dialog-small] ## Media Use the `AlertDialogMedia` component to add a media element such as an icon or image to the alert dialog. [Example: alert-dialog-media] ## Small with Media Use the `size="sm"` prop to make the alert dialog smaller and the `AlertDialogMedia` component to add a media element such as an icon or image to the alert dialog. [Example: alert-dialog-small-media] ## Destructive Use the `AlertDialogAction` component to add a destructive action button to the alert dialog. [Example: alert-dialog-destructive] ## API Reference ### size Use the `size` props on the `AlertDialogContent` component to control the size of the alert dialog. It accepts the following values: | Prop | Type | Default | | ------ | ------------------- | ----------- | | `size` | `"default" \| "sm"` | `"default"` | See the [UI SDK](https://ui-sdk.dev/docs/solid/components/alert-dialog) documentation for more information. # Aspect Ratio Source: https://www.solid-ui.com/docs/components/aspect-ratio.md > Displays content within a desired ratio. [Example: aspect-ratio-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add aspect-ratio ``` Copy and paste the following code into your project. [Source: components/ui/aspect-ratio.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { AspectRatio } from "~/components/ui/aspect-ratio" ``` ```tsx Mountain landscape ``` ## Square A square aspect ratio component using the `ratio={1 / 1}` prop. This is useful for displaying images in a square format. [Example: aspect-ratio-square] ## Portrait A portrait aspect ratio component using the `ratio={9 / 16}` prop. This is useful for displaying images in a portrait format. [Example: aspect-ratio-portrait] ## API Reference ### AspectRatio The `AspectRatio` component displays content within a desired ratio. | Prop | Type | | ------- | -------- | | `ratio` | `number` | | `class` | `string` | # Attachment Source: https://www.solid-ui.com/docs/components/attachment.md > Displays a file or image attachment with media, metadata, upload state, and actions. [Example: attachment-demo] The `Attachment` component displays a file or image attachment, its media, name, and metadata, with optional actions and upload state. Use it for files and images in chat composers, message threads, and upload lists. ## Installation Command Manual ```bash npx solidui-cli@latest add attachment ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button ``` Copy and paste the following code into your project. [Source: components/ui/attachment.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle } from "~/components/ui/attachment" ``` ```tsx sales-dashboard.pdf PDF · 2.4 MB Remove ``` ## Composition Use the following composition to build an attachment: ```text Attachment ├── AttachmentMedia ├── AttachmentContent │ ├── AttachmentTitle │ └── AttachmentDescription ├── AttachmentActions │ └── AttachmentAction └── AttachmentTrigger ``` Use `AttachmentGroup` to lay out multiple attachments in a scrollable row: ```text AttachmentGroup ├── Attachment └── Attachment ``` ## Features - Icon and image media through `AttachmentMedia` - Upload states: `idle`, `uploading`, `processing`, `error`, and `done` with built-in styling and a shimmer while in progress - Three sizes and horizontal or vertical orientation - A full-card `AttachmentTrigger` that opens a link or dialog while the actions stay independently clickable - Scrollable, snapping `AttachmentGroup` with an edge fade - Customizable styling through the `class` prop on every part ## Image Set `variant="image"` on `AttachmentMedia` and render an `` inside it. Use `orientation="vertical"` to stack the media above the content. [Example: attachment-image] ## States Set `state` to reflect the upload lifecycle. `uploading` and `processing` shimmer the title, and `error` switches to a destructive treatment. [Example: attachment-states] ## Sizes Use `size` to switch between `default`, `sm`, and `xs`. [Example: attachment-sizes] ## Group Wrap attachments in `AttachmentGroup` to lay them out in a horizontally scrollable, snapping row with an edge fade. [Example: attachment-group] ## Trigger Add an `AttachmentTrigger` to make the whole card open a link or dialog. It fills the card behind the actions, so the actions stay clickable. [Example: attachment-trigger] ```tsx showLineNumbers {/* media, content, actions */} ( )} /> {/* ... */} ``` ## Accessibility `AttachmentAction` renders a `Button`, and `AttachmentTrigger` renders a real ` ``` ## Cursor Tailwind v4 [switched](https://tailwindcss.com/docs/upgrade-guide#buttons-use-the-default-cursor) from `cursor: pointer` to `cursor: default` for native button elements. To use pointer cursors for interactive buttons, add this base style: ```css showLineNumbers title="globals.css" @layer base { button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; } } ``` ## Size Use the `size` prop to change the size of the button. [Example: button-size] ## Default [Example: button-default] ## Outline [Example: button-outline] ## Secondary [Example: button-secondary] ## Ghost [Example: button-ghost] ## Destructive [Example: button-destructive] ## Link [Example: button-link] ## Icon [Example: button-icon] ## With Icon Remember to add the `data-icon="inline-start"` or `data-icon="inline-end"` attribute to the icon for the correct spacing. [Example: button-with-icon] ## Rounded Use the `rounded-full` class to make the button rounded. [Example: button-rounded] ## Spinner Render a `` component inside the button to show a loading state. Remember to add the `data-icon="inline-start"` or `data-icon="inline-end"` attribute to the spinner for the correct spacing. [Example: button-spinner] ## Button Group To create a button group, use the `ButtonGroup` component. See the [Button Group](/docs/components/button-group) documentation for more details. [Example: button-group-demo] ## Link Use the `render` prop on `Button` to give a link button styles. Spread the supplied props onto the ``, so it keeps its `href` and link semantics. [Example: button-aschild] ## API Reference ### Button `Button` renders UI SDK's Button, a native button with `type="button"` by default that accepts its HTML attributes. Use `render` to render another element, like a link. Return a Promise from `onClick` to keep the button pending until it settles: it gets `aria-busy` and `data-pending` and ignores presses meanwhile. See the [UI SDK Button API](https://ui-sdk.dev/docs/solid/components/button) for `focusableWhenDisabled` and `pendingAnnouncement`. | Prop | Type | Default | | --------- | ------------------------------------------------------------------------------------ | ----------- | | `variant` | `"default" \| "outline" \| "ghost" \| "destructive" \| "secondary" \| "link"` | `"default"` | | `size` | `"default" \| "xs" \| "sm" \| "lg" \| "icon" \| "icon-xs" \| "icon-sm" \| "icon-lg"` | `"default"` | | `render` | `(props, state) => JSX.Element` | - | | `class` | `string` | - | # Button Group Source: https://www.solid-ui.com/docs/components/button-group.md > A container that groups related buttons together with consistent styling. [Example: button-group-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add button-group ``` Install the following dependencies: ```bash npm install class-variance-authority ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add separator ``` Copy and paste the following code into your project. [Source: components/ui/button-group.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { ButtonGroup } from "~/components/ui/button-group" ``` ```tsx showLineNumbers ``` ## Composition Use the following composition to build a `ButtonGroup`: ```text ButtonGroup ├── Button or Input ├── ButtonGroupSeparator └── ButtonGroupText ``` ## Accessibility - `ButtonGroup` renders with `role="group"`. - Use `Tab` to navigate between controls in the group. - Add `aria-label` or `aria-labelledby` to describe the group purpose. ```tsx showLineNumbers ``` ## ButtonGroup vs ToggleGroup - Use `ButtonGroup` for grouped action buttons. - Use `ToggleGroup` when each control represents a selected or pressed state. ## Orientation Set the `orientation` prop to change the button group layout. [Example: button-group-orientation] ## Size Control the size of buttons using the `size` prop on individual buttons. [Example: button-group-size] ## Nested Nest `` components to create button groups with spacing. [Example: button-group-nested] ## Separator The `ButtonGroupSeparator` component visually divides buttons within a group. Buttons with variant `outline` do not need a separator since they have a border. For other variants, a separator is recommended to improve the visual hierarchy. [Example: button-group-separator] ## Split Create a split button group by adding two buttons separated by a `ButtonGroupSeparator`. [Example: button-group-split] ## Input Wrap an `Input` component with buttons. [Example: button-group-input] ## Input Group Wrap an `InputGroup` component to create complex input layouts. [Example: button-group-input-group] ## Dropdown Menu Create a split button group with a `DropdownMenu` component. [Example: button-group-dropdown] ## Select Pair with a `Select` component. [Example: button-group-select] ## Popover Use with a `Popover` component. [Example: button-group-popover] ## API Reference ### ButtonGroup Container for grouping related actions with shared radius and border merging. | Prop | Type | Default | | ------------- | ---------------------------- | -------------- | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | ```tsx ``` You can nest button groups to create segmented clusters. ```tsx {/* page buttons */} {/* next/previous buttons */} ``` ### ButtonGroupSeparator Visual separator that defaults to vertical orientation inside horizontal groups. | Prop | Type | Default | | ------------- | ---------------------------- | ------------ | | `orientation` | `"horizontal" \| "vertical"` | `"vertical"` | ```tsx ``` ### ButtonGroupText Non-interactive text slot for labels and inline context inside a group. | Prop | Type | Default | | ---- | ---------------- | ------- | | `as` | `ValidComponent` | - | ```tsx https:// .com ``` Use the `as` prop to render a custom component as the text. See the [Text as Label](#text-as-label) example. # Calendar Source: https://www.solid-ui.com/docs/components/calendar.md > A calendar component that allows users to select a date or a range of dates. [Example: calendar-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add calendar ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/calendar.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Calendar } from "~/components/ui/calendar" ``` ```tsx showLineNumbers ``` Dates use ISO strings, such as `"2026-11-17"`. Set `mode` to `single`, `multiple`, or `range`. `onValueChange` receives the ISO value. Use `months` for multiple grids and `min`, `max`, or `unavailable` for restrictions. The SDK renders focusable table cells, so days do not contain extra buttons. See the [UI SDK calendar API](https://ui-sdk.dev/docs/solid/components/calendar) for native options and keyboard behavior. ## About The `Calendar` component styles the grid, day cells, and navigation from [UI SDK Calendar](https://ui-sdk.dev/docs/solid/components/calendar). ## Date Picker You can use the `` component to build a date picker. See the [Date Picker](/docs/components/date-picker) page for more information. ## Persian / Hijri / Jalali Calendar The upstream example uses a Persian calendar with right-to-left layout. ## Selected Date (With TimeZone) The Calendar component accepts a `timeZone` prop to ensure dates are displayed and selected in the user's local timezone. **Note:** If you notice a selected date offset (for example, selecting the 20th highlights the 19th), make sure the `timeZone` prop is set to the user's local timezone. The SDK uses `timeZone` to determine today. Without it, the SDK reads the browser time zone after hydration. ## Basic A basic calendar styled with `class="rounded-lg border"`. [Example: calendar-basic] ## Range Calendar Use the `mode="range"` prop to enable range selection. [Example: calendar-range] ## Month and Year Selector Set `captionLayout="dropdown"` to change the visible month with month and year dropdowns. [Example: calendar-caption] ## Presets [Example: calendar-presets] ## Date and Time Picker [Example: calendar-time] ## Booked dates [Example: calendar-booked-dates] ## Custom Cell Size [Example: calendar-custom-days] Set `--cell-size` to a fixed value or use responsive utilities such as `[--cell-size:2rem] sm:[--cell-size:2.5rem]`. ## Week Numbers Add a column to the calendar grid to display ISO week numbers. [Example: calendar-week-numbers] ## API Reference See the [UI SDK Calendar API](https://ui-sdk.dev/docs/solid/components/calendar) for supported options and slot states. ## Changelog # Card Source: https://www.solid-ui.com/docs/components/card.md > Displays a card with header, content, and footer. [Example: card-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add card ``` Copy and paste the following code into your project. [Source: components/ui/card.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "~/components/ui/card" ``` ```tsx showLineNumbers Card Title Card Description Card Action

Card Content

Card Footer

``` ## Composition Use the following composition to build a `Card`: ```text Card ├── CardHeader │ ├── CardTitle │ ├── CardDescription │ └── CardAction ├── CardContent └── CardFooter ``` ## Size Use the `size="sm"` prop to set the size of the card to small. The small size variant uses smaller spacing. [Example: card-small] ## Spacing In addition to the `size` prop, you can use the `--card-spacing` CSS variable to control the spacing between sections and the inset of card parts. [Example: card-spacing] Use negative margins with `-mx-(--card-spacing)` to make content go edge to edge while keeping it aligned with the card inset. When the edge-to-edge content sits above a footer, use `-mb-(--card-spacing)` on `CardContent` to remove the section gap. [Example: card-edge-to-edge] ## Image Add an image before the card header to create a card with an image. [Example: card-image] ## API Reference ### Card | Prop | Type | | ------- | ------------------- | | `size` | `"default" \| "sm"` | | `class` | `string` | ### CardHeader The `CardHeader` component is used for a title, description, and optional action. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### CardTitle The `CardTitle` component is used for the card title. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### CardDescription The `CardDescription` component is used for helper text under the title. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### CardAction The `CardAction` component places content in the top-right of the header (for example, a button or a badge). | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### CardContent The `CardContent` component is used for the main card body. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ### CardFooter The `CardFooter` component is used for actions and secondary content at the bottom of the card. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ## Changelog ### Spacing Variable If you're upgrading from a previous version of the `Card` component, you'll need to apply the following updates to use the `--card-spacing` variable: Update the Card root spacing classes. Replace the hard-coded gap and vertical padding with `--card-spacing`, and set the default and small size values on the root: ```diff class={cn( - "group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", + "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", class )} ``` Update CardHeader spacing classes. Replace the horizontal padding and border spacing with the shared variable: ```diff class={cn( - "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", + "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", class )} ``` Update CardContent and CardFooter spacing classes. Use `--card-spacing` for the content inset and footer padding: ```diff function CardContent({ class, ...props }: ComponentProps<"div">) { return (
) } ``` ```diff class={cn( - "flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", + "flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", class )} ``` After applying these changes, you can customize card spacing by setting `--card-spacing` on the `Card` with an arbitrary property class: # Carousel Source: https://www.solid-ui.com/docs/components/carousel.md > A carousel with motion, swipe, and keyboard paging. [Example: carousel-demo] ## About Carousel is built on the [UI SDK Carousel](https://ui-sdk.dev/docs/solid/components/carousel), which handles paging, swiping, looping, autoplay, and keyboard support. ## Installation Command Manual ```bash npx solidui-cli@latest add carousel ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button ``` Copy and paste the following code into your project. [Source: components/ui/carousel.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CarouselViewport } from "~/components/ui/carousel" ``` ```tsx showLineNumbers Slide one Slide two ``` Compose `CarouselViewport` and `CarouselContent` under `Carousel`, then render explicit `CarouselItem` children. Configure it with props on `Carousel`, such as `page`, `onPageChange`, `loop`, `slidesPerPage`, and `controller`. Give vertical viewports an explicit height. See the [UI SDK carousel API](https://ui-sdk.dev/docs/solid/components/carousel) for native options and keyboard behavior. ## Composition Use the following composition to build a `Carousel`: ```text Carousel ├── CarouselViewport │ └── CarouselContent │ ├── CarouselItem │ └── CarouselItem ├── CarouselPrevious └── CarouselNext ``` ## Sizes To set the size of the items, you can use the `basis` utility class on the ``. [Example: carousel-size] ## Spacing To set the spacing between the items, we use a `pl-[VALUE]` utility on the `` and a negative `-ml-[VALUE]` on the ``. [Example: carousel-spacing] ## Orientation Use the `orientation` prop to set the orientation of the carousel. [Example: carousel-orientation] ## Options Pass options as props on `Carousel`: - `loop` continues from the last page to the first. - `slidesPerPage` sets how many slides one page holds, or `"auto"` to fit as many as the viewport shows. - `align` sets where a page lines up in the viewport. - `dragFree`, `skipSnaps`, and `drag` control how swipes and drags move the slides. See the [UI SDK Carousel API](https://ui-sdk.dev/docs/solid/components/carousel) for every option. ## Controlled Use `page` and `onPageChange` to read and set the current page. `onPageChange` receives the requested page and change details whose `reason` explains the change. `onPageChangeComplete` runs once the slides come to rest. To page the carousel from elsewhere, create a controller with `createCarouselController()`, which the carousel component exports, and pass it as `controller` to `Carousel` and to a `CarouselPrevious` or `CarouselNext` placed outside it. [Example: carousel-api] ## Autoplay Use `defaultPlaying` or `playing` with `interval` to rotate through the pages. Rotation pauses while the carousel is hovered, scrolled out of view, or in a hidden tab, and stops when the user pages. It doesn't start on its own when the user prefers reduced motion. [Example: carousel-plugin] ## API Reference See the [UI SDK Carousel API](https://ui-sdk.dev/docs/solid/components/carousel) for the full API reference. # Checkbox Source: https://www.solid-ui.com/docs/components/checkbox.md > A control that allows the user to toggle between checked and not checked. [Example: checkbox-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add checkbox ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/checkbox.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Checkbox } from "~/components/ui/checkbox" ``` ```tsx ``` ## Checked State Use `defaultChecked` for uncontrolled checkboxes, or `checked` and `onCheckedChange` to control the state. ## Invalid State Set `aria-invalid` on the checkbox and `data-invalid` on the field wrapper to show the invalid styles. [Example: checkbox-invalid] ## Basic Pair the checkbox with `Field` and `FieldLabel` for proper layout and labeling. [Example: checkbox-basic] ## Description Use `FieldContent` and `FieldDescription` for helper text. [Example: checkbox-description] ## Disabled Use the `disabled` prop to prevent interaction and add the `data-disabled` attribute to the `` component for disabled styles. [Example: checkbox-disabled] ## Group Use multiple fields to create a checkbox list. [Example: checkbox-group] ## Table [Example: checkbox-table] ## API Reference See the [UI SDK](https://ui-sdk.dev/docs/solid/components/checkbox) documentation for more information. # Code Block Source: https://www.solid-ui.com/docs/components/code-block.md > Displays code, terminal output and diffs with an optional header, line numbers and a copy button. [Example: code-block-demo] `CodeBlock` displays code, terminal output, logs and diffs. It has a header with a title and actions, line numbers, wrapping, diff and highlighted lines, and a small size for tool output in a [Trace](/docs/components/trace). Syntax highlighting is optional and lives in a separate hook, so a block that only shows plain output stays small. ## Installation Command Manual ```bash npx solidui-cli@latest add code-block ``` Install the following dependencies: ```bash npm install shiki ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button ``` Copy and paste the following code into your project. [Source: components/ui/code-block.tsx] [Source: hooks/use-highlighted-code.ts] [Source: lib/highlighter.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockHeader, CodeBlockTitle } from "~/components/ui/code-block" ``` ```tsx showLineNumbers Terminal pnpm dev ``` Compose header, title, actions, content, and footer inside `CodeBlock`. `CodeBlockContent` accepts plain text or explicit `CodeBlockLine` children. Set `lineNumbers`, `startLine`, or `wrap`; line variants are `added`, `removed`, and `highlighted`. `CodeBlockCopyButton` takes `value` and reports clipboard success or failure accessibly. The content accepts pre-highlighted JSX; it does not bundle a syntax highlighter. ## Composition ```text CodeBlock ├── CodeBlockHeader │ ├── CodeBlockTitle │ └── CodeBlockActions │ └── CodeBlockCopyButton ├── CodeBlockActions (floating, when there is no header) ├── CodeBlockContent │ └── CodeBlockLine └── CodeBlockFooter ``` `CodeBlockContent` takes a string or a list of `CodeBlockLine`. Use lines when you need line variants or highlighted tokens. ## Features - **It streams cheaply.** A string child renders as one text node, and the highlighter tokenizes only the new lines as code arrives. - **It copies cleanly.** Line numbers and diff markers are left out of a selection, and blank lines survive the copy. - **It reads left to right.** The content is always `dir="ltr"`. The header follows the page direction. - **It highlights without WASM.** `useHighlightedCode` uses Shiki's JavaScript engine, loads the language grammars on first use and renders ANSI colors in terminal output. On the server, `highlightCode` keeps Shiki out of the client bundle. - **It fits where code shows up.** Use it in a message, a Markdown fence, a Trace line, Tabs, a Dialog or a `typeset` container. - **It scrolls by keyboard.** The content is focusable, and floating actions show on focus as well as on hover. ## Basic Pass a string to `CodeBlockContent`. It renders as one text node, so it stays cheap while output streams. [Example: code-block-basic] ## Header `CodeBlockHeader` holds a `CodeBlockTitle` and `CodeBlockActions`. `CodeBlockCopyButton` copies its `value`. [Example: code-block-header] A long title truncates. To link the title to a file, wrap `CodeBlockTitle` in an anchor. ## Actions `CodeBlockActions` holds any number of buttons. For a wrap toggle, keep the state yourself and pass it to `wrap`. [Example: code-block-actions] ## Floating Actions Without a header, put `CodeBlockActions` directly inside `CodeBlock`. The actions float at the top end and stay hidden until the block is hovered or focused. They always show on touch screens. [Example: code-block-floating-actions] ## Line Numbers Add `lineNumbers` to `CodeBlockContent`. A string child is split into lines, and the numbers are not copied with a selection. [Example: code-block-line-numbers] ## Start Line Set `startLine` to number lines from a given line, for a snippet from the middle of a file. The gutter grows to fit the widest number. [Example: code-block-start-line] ## Wrap Long lines scroll by default. Add `wrap` to wrap them, which suits tool output and error messages. To let the reader toggle it, see [Actions](#actions). [Example: code-block-wrap] ## Highlighted Lines Render each line as a `CodeBlockLine` and set `variant="highlighted"` on the lines to call out. [Example: code-block-highlighted-lines] ## Diff Set `variant="added"` or `variant="removed"` on a `CodeBlockLine`. Each one adds a `+` or `−` marker. [Example: code-block-diff] ## Height Cap the height with a `max-h-*` class on `CodeBlockContent`. The content scrolls inside the block. [Example: code-block-height] `CodeBlockContent` fades the left and right edges by default and the top and bottom edges when it wraps. Add `scroll-fade-y` from the [shared stylesheet](/docs/#shared-styles) to a capped block that does not wrap. ## Show More `CodeBlockFooter` is a slot below the content. For Show More, cap the content while it is collapsed and put a ghost `xs` `Button` in the footer. [Example: code-block-show-more] ### Max Height To keep a long block from taking over the page, raise the cap instead of removing it. The expanded content scrolls, and the edges fade as you scroll. [Example: code-block-show-more-scroll] ## Size Use `size="sm"` for tool and [Trace](#trace) output. It has tighter padding and `text-xs` text. [Example: code-block-size] ## Destructive Use `variant="destructive"` for errors and failed output. [Example: code-block-destructive] ## Trace Put a `CodeBlock` with `size="sm"` in `TraceCollapsibleContent` for tool and terminal output. Add `wrap` and a `max-h-64` class to `CodeBlockContent` so long output wraps and scrolls inside the trace. The block sets its own text color, so `TraceCollapsibleContent` does not mute it. [Example: code-block-trace] ## Tabs Show several files with [Tabs](/docs/components/tabs), one `CodeBlock` in each `TabsContent`. [Example: code-block-tabs] ## Message Put a `CodeBlock` between paragraphs inside a [Message](/docs/components/message). [Example: code-block-chat] ## Typeset A `CodeBlock` between paragraphs keeps its code styling and copy controls in a prose layout. [Example: code-block-typeset] ## Syntax Highlighting `useHighlightedCode` highlights with [Shiki](https://shiki.style) and returns a Solid JSX element for each `CodeBlockLine`. [Example: code-block-highlighting] Shiki uses its JavaScript regex engine, so there is no WASM to load. ### Languages Configure the available grammars in `lib/highlighter.tsx`. Unrecognized languages render as plain text. [Example: code-block-languages] The demo includes TypeScript, CSS, JSON, and Python. ### Terminal Output Pass `"ansi"` as the language to render the colors in terminal output. Without it, escape codes show as text. [Example: code-block-ansi] ANSI colors do not carry from one line to the next. ### Server Rendering Call `highlightCode` from Astro frontmatter to render highlighted HTML at build time. ### Streaming Pass an accessor for the growing buffer to `useHighlightedCode`. Keep copy disabled until the block is complete. [Example: code-block-streaming] ### Markdown Render inline Markdown code with `` and fenced code with `CodeBlock`. This preview streams a sample response to show how the fenced block updates. [Example: code-block-markdown] ## Accessibility - `CodeBlockContent` is a `pre` with a `code` element and always sets `dir="ltr"`, so code reads left to right on an RTL page. - `CodeBlockContent` has `tabindex={0}`, so keyboard users can focus it and scroll it. Pass `tabindex={-1}` to remove the tab stop. - Floating actions show when focus is inside the block, not only on hover, so keyboard users can reach them. - Line numbers are hidden from screen readers. - Diff lines carry a `+` or `−` marker as well as a tint, so the change does not rely on color. - `CodeBlockCopyButton` is labelled "Copy", and a polite live region announces "Copied" after a successful copy. - Give a wrap toggle `aria-pressed` so its state is announced. - Give a Show More button `aria-expanded` and point `aria-controls` at the `id` of `CodeBlockContent`. ## API Reference ### CodeBlock The surface that holds the header, the content and the footer. | Prop | Type | Default | Description | | --------- | ---------------------------- | ----------- | --------------------------------------------------------------- | | `variant` | `"default" \| "destructive"` | `"default"` | The tone of the block. | | `size` | `"default" \| "sm"` | `"default"` | `"sm"` has tighter padding and `text-xs` code, for tool output. | | `class` | `string` | - | Additional classes to apply to the block. | ### CodeBlockHeader A row above the content for a title and actions. | Prop | Type | Default | Description | | ------- | -------- | ------- | ------------------------------------------ | | `class` | `string` | - | Additional classes to apply to the header. | ### CodeBlockTitle A filename or a label, with an optional icon. It truncates. | Prop | Type | Default | Description | | ------- | -------- | ------- | ----------------------------------------- | | `class` | `string` | - | Additional classes to apply to the title. | ### CodeBlockActions Holds buttons at the end of the header. As a direct child of `CodeBlock`, it floats. | Prop | Type | Default | Description | | ------- | -------- | ------- | ------------------------------------------- | | `class` | `string` | - | Additional classes to apply to the actions. | ### CodeBlockCopyButton A ghost icon button that copies `value` to the clipboard. It accepts the props of [`Button`](/docs/components/button). | Prop | Type | Default | Description | | ------- | -------- | ------- | ------------------------------------------ | | `value` | `string` | - | Required. The text to copy. | | `class` | `string` | - | Additional classes to apply to the button. | ### CodeBlockContent The `pre` that scrolls or wraps. | Prop | Type | Default | Description | | ------------- | ------------- | ------- | --------------------------------------------------------------- | | `children` | `JSX.Element` | - | A string, or a list of `CodeBlockLine`. | | `wrap` | `boolean` | `false` | Wrap long lines instead of scrolling. | | `lineNumbers` | `boolean` | `false` | Number each line. A string child is split into lines. | | `startLine` | `number` | `1` | The number of the first line, when `lineNumbers` is set. | | `tabindex` | `number` | `0` | Makes the content focusable so it can be scrolled by keyboard. | | `class` | `string` | - | Additional classes to apply to the content, such as `max-h-72`. | ### CodeBlockLine One line of code. | Prop | Type | Default | Description | | --------- | ---------------------------------------------------- | ----------- | ---------------------------------------- | | `variant` | `"default" \| "added" \| "removed" \| "highlighted"` | `"default"` | The state of the line. | | `class` | `string` | - | Additional classes to apply to the line. | ### CodeBlockFooter A row below the content, such as for a Show More button. | Prop | Type | Default | Description | | ------- | -------- | ------- | ------------------------------------------ | | `class` | `string` | - | Additional classes to apply to the footer. | ### useHighlightedCode Returns an accessor for the highlighted lines. Unrecognized languages render as plain text. | Argument | Type | Description | | ---------- | ------------------ | ------------------------------------------------------------ | | `code` | `Accessor` | The code to highlight. | | `language` | `Accessor` | A language or alias from `lib/highlighter.tsx`, or `"ansi"`. | # Collapsible Source: https://www.solid-ui.com/docs/components/collapsible.md > An interactive component which expands/collapses a panel. [Example: collapsible-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add collapsible ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/collapsible.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "~/components/ui/collapsible" ``` ```tsx showLineNumbers Can I use this in my project? Yes. Free to use for personal and commercial projects. No attribution required. ``` ## Composition Use the following composition to build a `Collapsible`: ```text Collapsible ├── CollapsibleTrigger └── CollapsibleContent ``` ## Controlled State Use `open` and `onOpenChange` to fully control the expanded state. ```tsx showLineNumbers const [open, setOpen] = createSignal(false) Toggle details Controlled content ``` ## Basic [Example: collapsible-basic] ## Settings Panel Use a trigger button to reveal additional settings. [Example: collapsible-settings] ## File Tree Use nested collapsibles to build a file tree. [Example: collapsible-file-tree] ## API Reference | Part | Description | | -------------------- | ------------------------------------------------------------ | | `Collapsible` | Root container that manages expanded state and interactions. | | `CollapsibleTrigger` | Interactive control used to toggle content visibility. | | `CollapsibleContent` | Expandable content region associated with the trigger. | # Combobox Source: https://www.solid-ui.com/docs/components/combobox.md > Autocomplete input with a list of suggestions. [Example: combobox-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add combobox ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button input-group ``` Copy and paste the following code into your project. [Source: components/ui/combobox.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Combobox, ComboboxContent, ComboboxInput, ComboboxItem, ComboboxList, ComboboxEmpty } from "~/components/ui/combobox" ; Solid Astro No framework found. ``` Use `value` and `onValueChange` for selection, and `query` and `onQueryChange` for controlled search text. Set `autoHighlight="always"` to highlight an option as the list opens. Object values use `itemToValue` and `itemToLabel`. Multiple selection uses `multiple`, `ComboboxChips`, `ComboboxValue`, `ComboboxChip`, and `ComboboxChipRemove`. ## Composition ### Simple A single-line input and a flat list (see [Basic](#basic)). ```text Combobox ├── ComboboxInput └── ComboboxContent ├── ComboboxEmpty └── ComboboxList ├── ComboboxItem └── ComboboxItem ``` ### With chips Multi-select with `multiple`, chips, and a chips input (see [Multiple](#multiple)). ```text Combobox ├── ComboboxChips │ ├── ComboboxValue │ │ └── ComboboxChip │ │ └── ComboboxChipRemove │ └── ComboboxChipInput └── ComboboxContent ├── ComboboxEmpty └── ComboboxList ├── ComboboxItem └── ComboboxItem ``` ### With groups Render items inside each `ComboboxGroup` and use a separator between groups (see [Groups](#groups)). ```text Combobox ├── ComboboxInput └── ComboboxContent ├── ComboboxEmpty └── ComboboxList ├── ComboboxGroup │ ├── ComboboxLabel │ ├── ComboboxItem │ └── ComboboxItem ├── ComboboxSeparator └── ComboboxGroup ├── ComboboxLabel ├── ComboboxItem └── ComboboxItem ``` ## Basic A simple combobox with a list of frameworks. [Example: combobox-basic] ## Multiple Use `multiple` and `ComboboxChips` to select more than one option and show each selection as a chip. [Example: combobox-multiple] ## Clear Button Use `showClear` on `ComboboxInput` to show a clear button. [Example: combobox-clear] ## Groups Use `ComboboxGroup` and `ComboboxSeparator` to group items. [Example: combobox-groups] ## Custom Items Render a custom component inside `ComboboxItem`. For object values, pass `itemToValue` and `itemToLabel` to `Combobox`. [Example: combobox-custom] ## Invalid Set `aria-invalid` on `ComboboxInput` to show the invalid state. [Example: combobox-invalid] ## Disabled Set `disabled` on `ComboboxInput` to disable the input. [Example: combobox-disabled] ## Auto Highlight Use the `autoHighlight` prop to automatically highlight the first item on filter. [Example: combobox-auto-highlight] ## Popup Use the `render` prop on `ComboboxTrigger` to open the popup from a button. Put `ComboboxInput` inside `ComboboxContent` to search within the popup. [Example: combobox-popup] ## Input Group Put an `InputGroupAddon` inside `ComboboxInput` to add an icon alongside the search field. [Example: combobox-input-group] ## API Reference See the [UI SDK Combobox API](https://ui-sdk.dev/docs/solid/components/combobox) for selection, filtering, and keyboard behavior. # Command Source: https://www.solid-ui.com/docs/components/command.md > Command menu for search and quick actions. [Example: command-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add command ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add dialog input-group ``` Copy and paste the following code into your project. [Source: components/ui/command.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Command, CommandInput, CommandList, CommandGroup, CommandGroupLabel, CommandItem, CommandEmpty } from "~/components/ui/command" ``` ```tsx console.log(value)}> Suggestions Calendar Settings No results found. ``` `onAction` receives the command value when a command runs. `onValueChange` reports the highlighted command. Use `query` and `onQueryChange` to control search text; native filtering works with composed items. `CommandDialog` wraps the command palette in a named dialog. ## Composition Use the following composition to build a `Command`: ```text Command ├── CommandInput └── CommandList ├── CommandEmpty ├── CommandGroup │ ├── CommandItem │ └── CommandItem ├── CommandSeparator └── CommandGroup ├── CommandItem └── CommandItem ``` ## Basic A simple command menu in a dialog. [Example: command-basic] ## Shortcuts [Example: command-shortcuts] ## Groups A command menu with groups, icons and separators. [Example: command-groups] ## Scrollable Scrollable command menu with multiple items. [Example: command-scrollable] ## API Reference See the [UI SDK Command API](https://ui-sdk.dev/docs/solid/components/command) for filtering options and keyboard behavior. # Context Menu Source: https://www.solid-ui.com/docs/components/context-menu.md > Displays a menu of actions triggered by a right click. [Example: context-menu-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add context-menu ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/context-menu.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "~/components/ui/context-menu" ``` ```tsx showLineNumbers Right click here Profile Billing Team Subscription ``` ## Composition Use the following composition to build a `ContextMenu`: ```text ContextMenu ├── ContextMenuTrigger └── ContextMenuContent ├── ContextMenuGroup │ ├── ContextMenuLabel │ ├── ContextMenuItem │ └── ContextMenuItem ├── ContextMenuSeparator ├── ContextMenuGroup │ ├── ContextMenuLabel │ ├── ContextMenuCheckboxItem │ └── ContextMenuCheckboxItem ├── ContextMenuSeparator ├── ContextMenuGroup │ ├── ContextMenuLabel │ └── ContextMenuRadioGroup │ ├── ContextMenuRadioItem │ └── ContextMenuRadioItem └── ContextMenuSub ├── ContextMenuSubTrigger └── ContextMenuSubContent └── ContextMenuGroup ├── ContextMenuItem └── ContextMenuItem ``` ## Basic A simple context menu with a few actions. [Example: context-menu-basic] ## Submenu Use `ContextMenuSub` to nest secondary actions. [Example: context-menu-submenu] ## Shortcuts Add `ContextMenuShortcut` to show keyboard hints. [Example: context-menu-shortcuts] ## Groups Group related actions and separate them with dividers. [Example: context-menu-groups] ## Icons Combine icons with labels for quick scanning. [Example: context-menu-icons] ## Checkboxes Use `ContextMenuCheckboxItem` for toggles. [Example: context-menu-checkboxes] ## Radio Use `ContextMenuRadioItem` for exclusive choices. [Example: context-menu-radio] ## Destructive Use `variant="destructive"` to style the menu item as destructive. [Example: context-menu-destructive] ## API Reference | Part | Description | | ------------------------- | --------------------------------------------------- | | `ContextMenu` | Root container that manages right-click open state. | | `ContextMenuTrigger` | Element that listens for right-click or long press. | | `ContextMenuContent` | Floating menu content rendered in a portal. | | `ContextMenuGroup` | Group wrapper for related items. | | `ContextMenuLabel` | Non-interactive label for a group. | | `ContextMenuItem` | Standard action item with optional variants/inset. | | `ContextMenuShortcut` | Right-aligned text for keyboard hints. | | `ContextMenuSeparator` | Visual separator between groups. | | `ContextMenuSub` | Wrapper for nested submenus. | | `ContextMenuSubTrigger` | Trigger item that opens a submenu. | | `ContextMenuSubContent` | Floating submenu content panel. | | `ContextMenuCheckboxItem` | Toggle item with checked indicator. | | `ContextMenuRadioGroup` | Group container for mutually-exclusive options. | | `ContextMenuRadioItem` | Radio item used inside `ContextMenuRadioGroup`. | See the [UI SDK](https://ui-sdk.dev/docs/solid/components/menu) documentation for more information. # Date Picker Source: https://www.solid-ui.com/docs/components/date-picker.md > A date picker component with range and presets. [Example: date-picker-demo] ## Installation The Date Picker is built using a composition of the `` and the `` components. See the installation instructions for [Popover](/docs/components/popover#installation) and [Calendar](/docs/components/calendar#installation). ## Usage [Source: components/example-date-picker.tsx] See the [UI SDK Calendar API](https://ui-sdk.dev/docs/solid/components/calendar) for date values, selection modes, and keyboard behavior. ## Composition A date picker is built from `Popover` and `Calendar` (there is no `DatePicker` root component): ```text Popover ├── PopoverTrigger └── PopoverContent └── Calendar ``` ## Basic A basic date picker component. [Example: date-picker-basic] ## Range Picker A date picker component for selecting a range of dates. [Example: date-picker-range] ## Date of Birth A date picker component for selecting a date of birth. This component includes a dropdown caption layout for date and month selection. [Example: date-picker-dob] ## Input A date picker component with an input field for selecting a date. [Example: date-picker-input] ## Time Picker A date picker component with a time input field for selecting a time. [Example: date-picker-time] ## Natural Language Picker This component uses the `chrono-node` library to parse natural language dates. [Example: date-picker-natural-language] # Delta Bar Source: https://www.solid-ui.com/docs/components/delta-bar.md > Bar to show negative or positive deviation from a particular threshold. [Example: delta-bar-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add delta-bar ``` Copy and paste the following code into your project. [Source: components/ui/delta-bar.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { DeltaBar } from "~/components/ui/delta-bar" ``` ```tsx showLineNumbers ``` ## Examples ### Inverted Semantics Use `isIncreasePositive={false}` when increases should be shown as unfavorable, like latency or cost. [Example: delta-bar-inverted] ### Custom Colors Use `data-tone="positive|negative"` selectors from the root `class` to override the default indicator and marker colors. [Example: delta-bar-custom-colors] ## API Reference ### DeltaBar | Prop | Type | Default | | -------------------- | --------- | ------- | | `value` | `number` | - | | `isIncreasePositive` | `boolean` | `true` | | `class` | `string` | - | # Dialog Source: https://www.solid-ui.com/docs/components/dialog.md > A window overlaid on either the primary window or another dialog window, rendering the content underneath inert. [Example: dialog-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add dialog ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button ``` Copy and paste the following code into your project. [Source: components/ui/dialog.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "~/components/ui/dialog" ``` ```tsx showLineNumbers Open Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ``` ## Composition Use the following composition to build a `Dialog`: ```text Dialog ├── DialogTrigger └── DialogContent ├── DialogHeader │ ├── DialogTitle │ └── DialogDescription └── DialogFooter ``` ## Custom Close Button Replace the default close control with your own button. [Example: dialog-close-button] ## No Close Button Use `showCloseButton={false}` to hide the close button. [Example: dialog-no-close-button] ## Sticky Footer Keep actions visible while the content scrolls. [Example: dialog-sticky-footer] ## Scrollable Content Long content can scroll while the header stays in view. [Example: dialog-scrollable-content] ## API Reference | Part | Description | | ------------------- | ------------------------------------------------------------- | | `Dialog` | Root component that manages open state and focus behavior. | | `DialogTrigger` | Interactive element used to open the dialog. | | `DialogContent` | Overlay + content container rendered in a portal. | | `DialogHeader` | Layout wrapper for title and description content. | | `DialogTitle` | Accessible heading for the dialog content. | | `DialogDescription` | Supporting text that describes the dialog purpose. | | `DialogFooter` | Footer container for actions, usually confirm/cancel buttons. | | `DialogClose` | Interactive element used to close the dialog. | See the [UI SDK](https://ui-sdk.dev/docs/solid/components/dialog) documentation for more information. # Direction Source: https://www.solid-ui.com/docs/components/direction.md > A provider component that sets the text direction for your application. The `DirectionProvider` component is used to set the text direction (`ltr` or `rtl`) for your application. This is essential for supporting right-to-left languages like Arabic, Hebrew, and Persian. Here's a preview of the component in RTL mode. Use the language selector to switch the language. To see more examples, look for the RTL section on components pages. ## Installation Command Manual ```bash npx solidui-cli@latest add direction ``` Copy and paste the following code into your project. [Source: components/ui/direction.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { DirectionProvider } from "~/components/ui/direction" ``` ```tsx showLineNumbers
محتوى التطبيق
``` ## useDirection Use `useDirection()` to read the current direction from context. ```tsx showLineNumbers import { useDirection } from "~/components/ui/direction" const Example = () => { const direction = useDirection() return
Current direction: {direction()}
} ``` # Drawer Source: https://www.solid-ui.com/docs/components/drawer.md > A panel that slides in from an edge of the screen, with dragging and snap points. [Example: drawer-demo] ## About Drawer is built on the [UI SDK Drawer](https://ui-sdk.dev/docs/solid/components/drawer). It shares Dialog's focus and dismissal behavior and adds dragging, snap points, and a handle you can use with the keyboard. ## Installation Command Manual ```bash npx solidui-cli@latest add drawer ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/drawer.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "~/components/ui/drawer" ``` ```tsx showLineNumbers Open Activity goal Review your daily goal. Done ``` Use `side`, `snapPoints`, and `defaultSnapPoint` from the SDK. Content renders in place using the browser top layer. The SDK owns positioning and movement. See the [UI SDK drawer API](https://ui-sdk.dev/docs/solid/components/drawer) for native options and keyboard behavior. ## Composition Use the following composition to build a `Drawer`: ```text Drawer ├── DrawerTrigger └── DrawerContent ├── DrawerHeader │ ├── DrawerTitle │ └── DrawerDescription └── DrawerFooter ``` ## Scrollable Content Keep actions visible while the content scrolls. [Example: drawer-scrollable-content] ## Sides Set `side` on `Drawer` to open it from the `top`, `right`, `bottom`, or `left`. [Example: drawer-sides] ## Responsive Dialog You can combine the `Dialog` and `Drawer` components to create a responsive dialog. This renders a `Dialog` component on desktop and a `Drawer` on mobile. [Example: drawer-dialog] ## API Reference See the [UI SDK Drawer API](https://ui-sdk.dev/docs/solid/components/drawer) for the full API reference. # Dropdown Menu Source: https://www.solid-ui.com/docs/components/dropdown-menu.md > Displays a menu to the user — such as a set of actions or functions — triggered by a button. [Example: dropdown-menu-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add dropdown-menu ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/dropdown-menu.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "~/components/ui/dropdown-menu" ``` ```tsx showLineNumbers Open My Account Profile Billing Support ``` ## Composition Use the following composition to build a `DropdownMenu`: ```text DropdownMenu ├── DropdownMenuTrigger └── DropdownMenuContent ├── DropdownMenuGroup │ ├── DropdownMenuLabel │ ├── DropdownMenuItem │ └── DropdownMenuItem ├── DropdownMenuSeparator ├── DropdownMenuGroup │ ├── DropdownMenuLabel │ ├── DropdownMenuCheckboxItem │ └── DropdownMenuCheckboxItem ├── DropdownMenuSeparator ├── DropdownMenuGroup │ ├── DropdownMenuLabel │ └── DropdownMenuRadioGroup │ ├── DropdownMenuRadioItem │ └── DropdownMenuRadioItem └── DropdownMenuSub ├── DropdownMenuSubTrigger └── DropdownMenuSubContent └── DropdownMenuGroup ├── DropdownMenuLabel ├── DropdownMenuItem └── DropdownMenuItem ``` ## Basic A basic dropdown menu with labels and separators. [Example: dropdown-menu-basic] ## Submenu Use `DropdownMenuSub` to nest secondary actions. [Example: dropdown-menu-submenu] ## Shortcuts Add `DropdownMenuShortcut` to show keyboard hints. [Example: dropdown-menu-shortcuts] ## Icons Combine icons with labels for quick scanning. [Example: dropdown-menu-icons] ## Checkboxes Use `DropdownMenuCheckboxItem` for toggles. [Example: dropdown-menu-checkboxes] ## Checkboxes Icons Add icons to checkbox items. [Example: dropdown-menu-checkboxes-icons] ## Radio Group Use `DropdownMenuRadioGroup` for exclusive choices. [Example: dropdown-menu-radio-group] ## Radio Icons Show radio options with icons. [Example: dropdown-menu-radio-icons] ## Destructive Use `variant="destructive"` for irreversible actions. [Example: dropdown-menu-destructive] ## Avatar An account switcher dropdown triggered by an avatar. [Example: dropdown-menu-avatar] ## Complex A richer example combining groups, icons, and submenus. [Example: dropdown-menu-complex] ## API Reference | Part | Description | | -------------------------- | -------------------------------------------------------- | | `DropdownMenu` | Root container that manages menu open state. | | `DropdownMenuTrigger` | Trigger element that opens and closes the menu. | | `DropdownMenuContent` | Floating menu content rendered in a portal. | | `DropdownMenuGroup` | Group wrapper for related items. | | `DropdownMenuLabel` | Non-interactive label for a menu group. | | `DropdownMenuItem` | Standard action item with optional variants and inset. | | `DropdownMenuShortcut` | Right-aligned text for keyboard shortcuts. | | `DropdownMenuSeparator` | Visual separator between groups or action sections. | | `DropdownMenuSub` | Wrapper for nested submenus. | | `DropdownMenuSubTrigger` | Trigger item that opens a submenu. | | `DropdownMenuSubContent` | Floating content panel for submenu items. | | `DropdownMenuCheckboxItem` | Toggle item with checked indicator. | | `DropdownMenuRadioGroup` | Group container for mutually exclusive radio selections. | | `DropdownMenuRadioItem` | Radio item used inside `DropdownMenuRadioGroup`. | # Empty Source: https://www.solid-ui.com/docs/components/empty.md > Use the Empty component to display an empty state. [Example: empty-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add empty ``` Install the following dependencies: ```bash npm install class-variance-authority ``` Copy and paste the following code into your project. [Source: components/ui/empty.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyTitle } from "~/components/ui/empty" ``` ```tsx showLineNumbers No projects yet You haven't created any projects yet. Get started by creating your first project. ``` ## Composition Use the following composition to build an `Empty` state: ```text Empty ├── EmptyHeader │ ├── EmptyMedia │ ├── EmptyTitle │ └── EmptyDescription └── EmptyContent ``` ## Outline Use the `border` utility class to create an outline empty state. [Example: empty-outline] ## Background Use the `bg-*` and `bg-gradient-*` utilities to add a background to the empty state. [Example: empty-background] ## Avatar Use the `EmptyMedia` component to display an avatar in the empty state. [Example: empty-avatar] ## Avatar Group Use the `EmptyMedia` component to display an avatar group in the empty state. [Example: empty-avatar-group] ## InputGroup You can add an `InputGroup` component to the `EmptyContent` component. [Example: empty-input-group] ## API Reference ### Empty The main component of the empty state. Wraps the `EmptyHeader` and `EmptyContent` components. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | | ```tsx ``` ### EmptyHeader The `EmptyHeader` component wraps the empty media, title, and description. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | | ```tsx ``` ### EmptyMedia Use the `EmptyMedia` component to display the media of the empty state such as an icon or an image. You can also use it to display other components such as an avatar. | Prop | Type | Default | | --------- | --------------------- | --------- | | `variant` | `"default" \| "icon"` | `default` | | `class` | `string` | | ```tsx ``` ```tsx CN ``` ### EmptyTitle Use the `EmptyTitle` component to display the title of the empty state. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | | ```tsx No data ``` ### EmptyDescription Use the `EmptyDescription` component to display the description of the empty state. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | | ```tsx You do not have any notifications. ``` ### EmptyContent Use the `EmptyContent` component to display the content of the empty state such as a button, input or a link. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | | ```tsx ``` # Field Source: https://www.solid-ui.com/docs/components/field.md > Combine labels, controls, and help text to compose accessible form fields and grouped inputs. [Example: field-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add field ``` Install the following dependencies: ```bash npm install class-variance-authority ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add label separator ``` Copy and paste the following code into your project. [Source: components/ui/field.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSet } from "~/components/ui/field" ``` ```tsx showLineNumbers
Profile This appears on invoices and emails. Full name This appears on invoices and emails. Username Choose another username. Subscribe to the newsletter
``` ## Composition ### Field A single control with label, helper text, and validation. ```text Field ├── FieldLabel ├── Input / Textarea / Switch / Select ├── FieldDescription └── FieldError ``` ### FieldGroup Related fields in one group. Use `FieldSeparator` between sections when needed. ```text FieldGroup ├── Field │ ├── FieldLabel │ ├── Input / Textarea / Switch / Select │ ├── FieldDescription │ └── FieldError ├── FieldSeparator └── Field ├── FieldLabel └── Input / Textarea / Switch / Select ``` ### FieldSet Semantic grouping with a legend and description, usually containing a `FieldGroup`. ```text FieldSet ├── FieldLegend ├── FieldDescription └── FieldGroup ├── Field │ ├── FieldLabel │ ├── Input / Textarea / Switch / Select │ ├── FieldDescription │ └── FieldError └── Field ├── FieldLabel └── Input / Textarea / Switch / Select ``` `FieldContent` and `FieldTitle` are local helpers you can use when horizontal or responsive layouts need extra structure around labels, descriptions, and errors. ## Anatomy The `Field` family is designed for composing accessible forms. A typical field is structured as follows: ```tsx showLineNumbers Label {/* Input, Select, Switch, etc. */} Optional helper text. Validation message. ``` - `Field` is the core wrapper for a single field. - `FieldContent` is a flex column that groups labels, descriptions, and errors. - Wrap related fields with `FieldGroup`, and use `FieldSet` with `FieldLegend` for semantic grouping. ## Form See the [Forms](/docs/forms/) documentation for building forms with the `Field` component and [Formisch](/docs/forms/formisch/). ## Input [Example: field-input] ## Textarea [Example: field-textarea] ## Select [Example: field-select] ## Slider [Example: field-slider] ## Fieldset [Example: field-fieldset] ## Checkbox [Example: field-checkbox] ## Radio [Example: field-radio] ## Switch [Example: field-switch] ## Choice Card Wrap each horizontal `Field` in a `FieldLabel` to make the whole choice card selectable. This example uses `RadioGroupItem`. [Example: field-choice-card] ## Field Group Stack `Field` components with `FieldGroup`. Add `FieldSeparator` to divide them. [Example: field-group] ## Responsive Layout - **Vertical fields:** Default orientation stacks label, control, and helper text—ideal for mobile-first layouts. - **Horizontal fields:** Set `orientation="horizontal"` on `Field` to align the label and control side-by-side. Pair with `FieldContent` to keep descriptions aligned. - **Responsive fields:** Set `orientation="responsive"` for automatic column layouts inside container-aware parents. Apply `@container/field-group` classes on `FieldGroup` to switch orientations at specific breakpoints. [Example: field-responsive] ## Validation and Errors - Add `data-invalid` to `Field` to switch the entire block into an error state. - Add `aria-invalid="true"` on the control itself for assistive technologies. - Render `FieldError` after the control or inside `FieldContent` to keep errors aligned. ```tsx showLineNumbers /data-invalid/ /aria-invalid/ Email Enter a valid email address. ``` ## Accessibility - `FieldSet` and `FieldLegend` keep related controls grouped for keyboard and assistive tech users. - `Field` renders `role="group"` so nested controls can inherit labels and descriptions. - Use `FieldSeparator` sparingly so section boundaries stay clear for screen readers. ## API Reference ### FieldSet Container that renders a semantic `fieldset` with spacing presets. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx
Delivery {/* Fields */}
``` ### FieldLegend Legend element for a `FieldSet`. Switch to the `label` variant to align with label sizing. | Prop | Type | Default | | --------- | --------------------- | ---------- | | `variant` | `"legend" \| "label"` | `"legend"` | | `class` | `string` | - | ```tsx Notification Preferences ``` ### FieldGroup Layout wrapper that stacks `Field` components and enables container queries for responsive orientations. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx {/* ... */} {/* ... */} ``` ### Field The core wrapper for a single field. Provides orientation control and invalid-state styling. | Prop | Type | Default | | -------------- | -------------------------------------------- | ------------ | | `orientation` | `"vertical" \| "horizontal" \| "responsive"` | `"vertical"` | | `class` | `string` | - | | `data-invalid` | `boolean` | - | ```tsx Remember me ``` ### FieldContent Flex column that groups control descriptions when label and control are arranged side by side. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx Notifications Email, SMS, and push options. ``` ### FieldLabel Label styled for direct controls and nested field-card layouts. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx Email ``` ### FieldTitle Renders a title with label styling inside `FieldContent`. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx Enable Touch ID Unlock your device faster. ``` ### FieldDescription Helper text slot that balances long lines in horizontal layouts. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx We never share your email with anyone. ``` ### FieldSeparator Visual divider to separate sections inside a `FieldGroup`. Accepts optional inline content. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx Or continue with ``` ### FieldError Accessible error container that accepts children or an `errors` array, including validator issues. | Prop | Type | Default | | -------- | -------------------------------------------------- | ------- | | `errors` | `ReadonlyArray<{ message?: string } \| undefined>` | - | | `class` | `string` | - | ```tsx ``` When the `errors` array contains multiple messages, `FieldError` renders a list automatically. `FieldError` also accepts issues produced by any validator that implements [Standard Schema](https://standardschema.dev/), including Zod, Valibot, and ArkType. Pass the `issues` array from the schema result directly to render a unified error list across libraries. # Hover Card Source: https://www.solid-ui.com/docs/components/hover-card.md > For sighted users to preview content available behind a link. [Example: hover-card-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add hover-card ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/hover-card.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { HoverCard, HoverCardContent, HoverCardTrigger } from "~/components/ui/hover-card" ``` ```tsx showLineNumbers (
)} class="underline underline-offset-4" > Hover SolidJS - Simple and performant reactivity for building user interfaces. ``` ## Composition Use the following composition to build a `HoverCard`: ```text HoverCard ├── HoverCardTrigger └── HoverCardContent ``` ## Trigger Delays Use `openDelay` and `closeDelay` on `HoverCard` to control when content opens and closes. ```tsx showLineNumbers ( )} class="underline underline-offset-4" > Hover Content ``` ## Positioning Use `side`, `align`, and `sideOffset` on `HoverCardContent` to position the content. ```tsx showLineNumbers ( )} class="underline underline-offset-4" > Hover Content ``` ## Basic [Example: hover-card-demo] ## Sides [Example: hover-card-sides] ## API Reference | Part | Description | | ------------------ | --------------------------------------------------------- | | `HoverCard` | Root component that manages delays and floating state. | | `HoverCardTrigger` | Interactive trigger that opens content on hover or focus. | | `HoverCardContent` | Floating card content rendered inside a portal. | See the [UI SDK](https://ui-sdk.dev/docs/solid/components/hover-card) documentation for more information. # Input Source: https://www.solid-ui.com/docs/components/input.md > A text input component for forms and user data entry with built-in styling and accessibility features. [Example: input-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add input ``` Install the following dependencies: ```bash npm install @ui-sdk/solid @ui-sdk/core ``` Copy and paste the following code into your project. [Source: components/ui/input.tsx] Update the import paths to match your project setup. ## Usage ```tsx import { Input } from "~/components/ui/input" ``` ```tsx ``` ## Basic [Example: input-basic] ## Field Use `Field`, `FieldLabel`, and `FieldDescription` to create an input with a label and description. [Example: input-field] ## Field Group Use `FieldGroup` to show multiple `Field` blocks and to build forms. [Example: input-fieldgroup] ## Disabled Use the `disabled` prop to disable the input. To style the disabled state, add the `data-disabled` attribute to the `Field` component. [Example: input-disabled] ## Invalid Use the `aria-invalid` prop to mark the input as invalid. To style the invalid state, add the `data-invalid` attribute to the `Field` component. [Example: input-invalid] ## File Use the `type="file"` prop to create a file input. [Example: input-file] ## Inline Use `Field` with `orientation="horizontal"` to create an inline input. Pair with `Button` to create a search input with a button. [Example: input-inline] ## Grid Use a grid layout to place multiple inputs side by side. [Example: input-grid] ## Required Use the `required` attribute to indicate required inputs. [Example: input-required] ## Badge Use `Badge` in the label to highlight a recommended field. [Example: input-badge] ## Input Group To add icons, text, or buttons inside an input, use the `InputGroup` component. See the [Input Group](/docs/components/input-group) component for more examples. [Example: input-input-group] ## Button Group To add buttons to an input, use the `ButtonGroup` component. See the [Button Group](/docs/components/button-group) component for more examples. [Example: input-button-group] ## Form A full form example with multiple inputs, a select, and a button. [Example: input-form] ## Controlled Pass `value` and `onValueChange` to control the input. `onValueChange` receives the new text and change details whose `reason` says what changed it. For a starting value the user edits freely, use `defaultValue`. ```tsx const [name, setName] = createSignal("Pedro Duarte") ``` ## API Reference Input renders UI SDK's Input, which forwards every native `input` attribute. See the [UI SDK Input API](https://ui-sdk.dev/docs/solid/components/input) for `value`, `defaultValue`, `onValueChange` and `controller`. # Input Group Source: https://www.solid-ui.com/docs/components/input-group.md > Add addons, buttons, and helper content to inputs. [Example: input-group-demo] ## Installation Command Manual ```bash npx solidui-cli@latest add input-group ``` Install the required Solid UI dependencies: ```bash npx solidui-cli@latest add button input textarea ``` Copy and paste the following code into your project. [Source: components/ui/input-group.tsx] Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "~/components/ui/input-group" ``` ```tsx showLineNumbers https:// ``` ## Composition Use the following composition to build an `InputGroup`: ```text InputGroup ├── InputGroupInput / InputGroupTextarea └── InputGroupAddon ├── InputGroupText ├── InputGroupButton └── Custom content ``` ## Align Use the `align` prop on `InputGroupAddon` to position the addon relative to the control. For proper focus management, `InputGroupAddon` should be placed after `InputGroupInput` or `InputGroupTextarea` in the DOM. Use the `align` prop to visually position the addon. ### inline-start Use `align="inline-start"` to position the addon at the start of the input. This is the default. [Example: input-group-inline-start] ### inline-end Use `align="inline-end"` to position the addon at the end of the input. [Example: input-group-inline-end] ### block-start Use `align="block-start"` to position the addon above the input. [Example: input-group-block-start] ### block-end Use `align="block-end"` to position the addon below the input. [Example: input-group-block-end] ## Icon [Example: input-group-icon] ## Text [Example: input-group-text] ## Button [Example: input-group-button] ## Kbd [Example: input-group-kbd] ## Dropdown [Example: input-group-dropdown] ## Spinner [Example: input-group-spinner] ## Textarea [Example: input-group-textarea] ## Custom Input Add `data-slot="input-group-control"` to a custom input so `InputGroup` can style its focus state. This example uses a custom `textarea`. [Example: input-group-custom] ## API Reference ### InputGroup The main container that wraps inputs and addons. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | ```tsx showLineNumbers ``` ### InputGroupAddon Displays icons, text, buttons, or helper content alongside controls. | Prop | Type | Default | | ------- | ---------------------------------------------------------------- | ---------------- | | `align` | `"inline-start" \| "inline-end" \| "block-start" \| "block-end"` | `"inline-start"` | | `class` | `string` | - | ```tsx showLineNumbers ``` For ``, use `inline-start` or `inline-end`. For ``, use `block-start` or `block-end`. `InputGroupAddon` can render multiple buttons and icons. ```tsx showLineNumbers One Two ``` ### InputGroupButton Renders compact button actions inside addons. | Prop | Type | Default | | --------- | ----------------------------------------------------------------------------- | ---------- | | `size` | `"xs" \| "icon-xs" \| "sm" \| "icon-sm"` | `"xs"` | | `variant` | `"default" \| "destructive" \| "outline" \| "secondary" \| "ghost" \| "link"` | `"ghost"` | | `type` | `"button" \| "submit" \| "reset"` | `"button"` | | `class` | `string` | - | ```tsx showLineNumbers Send ``` ### InputGroupInput Input variant with `data-slot="input-group-control"` and input-group styles applied. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | All other props are forwarded to the underlying ``. ```tsx showLineNumbers ``` ### InputGroupTextarea Textarea variant with `data-slot="input-group-control"` and input-group styles applied. | Prop | Type | Default | | ------- | -------- | ------- | | `class` | `string` | - | All other props are forwarded to the underlying `