# UI Thing Documentation > **Note:** This documentation corresponds to **UI Thing CLI v0.2.0** (major update). # Introduction **UI Thing** is a collection of beautifully designed, reusable UI components built specifically for **Nuxt**, powered by Reka UI and Tailwind CSS. This project is inspired by **shadcn/ui**, with adaptations to fit Nuxt's framework and developer ecosystem. > **Note:** This is *not* a traditional component library you install via npm. Instead, it hands you open, editable code-so you can pick the components you need, copy them into your app, and customize as you see fit. ## Why "UI Thing" for Nuxt? - **Open Code Philosophy**:br Every component is fully visible and editable-no wrappers or opaque abstractions. This gives you full control to adapt the UI to your design system. This makes it especially AI-friendly, letting models read, understand, and even generate new components. - **Nuxt-Native**:br Created with the Nuxt ecosystem at heart, UI Thing respects Nuxt's conventions-whether you're on Nuxt 3 or upgrading to Nuxt 4-and integrates smoothly with your app's structure and tooling. - **DIY, Your Way**:br Rather than bundling code you can't touch, UI Thing encourages you to copy, paste, and personalize any component. The code becomes entirely yours-no extra layers, no wrappers. - **Learn & Build**:br This project started as an experiment-and a fun one at that. I wanted to explore building an entire component reference for Nuxt, and along the way, I created a CLI to streamline the dev experience. --- ## Comparison Table | Feature | UI Thing (for Nuxt) | Traditional Component Library | | ------------------ | -------------------------- | -------------------------------- | | Distribution | Copy-paste + CLI | Publish to npm, import as a dep | | Customization | Directly edit code | Override or wrap components | | Nuxt Compatibility | Built for Nuxt conventions | Generic (may require adaptation) | | CLI Support | Yes | Sometimes minimal or none | | Ideal Use Case | Highly customizable UIs | Quick plug-and-play UIs | --- ## How to Use It 1. **Browse** [component](https://uithing.com/components/accordion) docs and [examples](https://uithing.com/examples/cards). 2. **Use the CLI** (`npx ui-thing@latest add `) to scaffold components into your project, or copy-paste code manually. 3. **Customize** each component freely-tweak styles, logic, responsive behavior, or layout as needed. # Setup So you want to use UI Thing in your Nuxt project? Great! This guide will walk you through the steps to get started. ## Prerequisites Before you can use UI Thing, you need to have a Nuxt project. If you don't have one yet, you can create one with the following command: ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx nuxi@latest init my-app ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx nuxi@latest init my-app ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x nuxi@latest init my-app ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx nuxi@latest init my-app ``` :: This will create a new Nuxt project in the `my-app` directory. You can then navigate to that directory and start the development server: ```bash cd my-app && npm run dev ``` ## Initialization Once you have a Nuxt project, you can initialize UI Thing with the following command: ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest init ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest init ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest init ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest init ``` :: This command will ask you a bunch of question the first time you run it ```bash ✔ Which theme do you want to start with? › Violet ✔ Where is your tailwind.css file located? … app/assets/css/tailwind.css ✔ Where should your components be stored? … app/components/Ui ✔ Where should your composables be stored? … app/composables ✔ Where should your plugins be stored? … app/plugins ✔ Where should your utils be stored? … app/utils ✔ Should we just replace component files if they already exist? … yes ✔ Would you like to use the default filename when adding components? … yes ✔ Which package manager do you use? › Npm ``` ## Adding components Once initialized, add components by running: ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add ``` :: You'll be prompted to select the components you want. **UI Thing** will then: - Copy the selected components into your components directory - Add any required composables, utils, and plugins - Install missing dependencies - Update `nuxt.config` with necessary configuration ## Adding themes UI Thing ships with several pre-made themes. Add one to your project with: ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest theme ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest theme ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest theme ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest theme ``` :: This will ask you to select the theme you want to add to your project. Once you have selected a theme, UI Thing will ask you if you want to overwrite your `tailwind.css` file. If you answer yes, it will overwrite your `tailwind.css` file with the theme you selected. ⚠️ Please note that this will overwrite your `tailwind.css` file. If you have made any changes to this file, you will lose them. ### Theme source The themes included in this cli all come from [shadcn/ui theme page](https://ui.shadcn.com/themes){rel=""nofollow""}. So if you don't want to use this CLI to add themes, you can just customize your theme on that page and copy the code into your `tailwind.css` file. > Thanks shadcn for making these themes available for free! 🙏 # CLI ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest ``` :: ```sh Usage: ui-thing [options] [command] CLI for adding ui-thing components to your Nuxt application Options: -V, --version output the version number -h, --help display help for command Commands: init [options] Initialize UI Thing in your Nuxt project. add [options] [componentNames...] Add a list of components to your project. theme Add a new theme to your project. shortcuts Add the shortcuts composable to your project. prettier Add prettier config to your project. help [command] display help for command ``` ## init ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest init ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest init ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest init ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest init ``` :: This command will initialize UI Thing in your Nuxt project. This will: - Update your `nuxt.config` file - Add the necessary dependencies - Create a `ui-thing.config.ts` file with the default configuration It is recommended that you run this command in a new Nuxt project before adding any components. ```sh Usage: ui-thing init [options] Initialize UI Thing in your Nuxt project. ✅ Add tailwindcss to your project ✅ Update your nuxt.config file ✅ Add the necessary dependencies ✅ Create a ui-thing.config file with the default configuration Options: -f --force Overwrite config file if it exists. (default: false) -y --yes Skip prompts and use default values. (default: false) -n --nuxtVersion Specify the Nuxt version you are using. -h, --help display help for command ``` ## add ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add ``` :: This command will add a list of components to your project. If no argument is passed, it will ask you to select from a list of available components. ```sh ? Select the components you want to add > Instructions: ↑/↓: Highlight option ←/→/[space]: Toggle selection [a,b,c]/delete: Filter choices enter/return: Complete answer Filtered results for: Enter something to filter ◯ Accordion ◯ Alert ◯ Alert Dialog ◯ ApexCharts ◯ Apexcharts ◯ Aspect Ratio ◯ Autocomplete ◯ Avatar ◯ Badge ◯ Border Beam ``` ## theme The theme command allows you to add a new theme to your project. You can visit the [themes page](https://ui.shadcn.com/themes){rel=""nofollow""} on shadcn to see the available themes. ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest theme ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest theme ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest theme ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest theme ``` :: Running this command allows you to select a theme from the list ```sh ? Which theme do you want to add? » > Zinc Slate Stone Gray Neutral Red Rose Orange Green ↓ Blue ``` ## prettier The prettier command allows you to add an opinionated prettier config to your project. ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest prettier ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest prettier ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest prettier ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest prettier ``` :: This will create a `.prettierrc` file that looks like this ```json { "arrowParens": "always", "endOfLine": "lf", "plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"], "printWidth": 100, "semi": true, "singleQuote": false, "tabWidth": 2, "trailingComma": "es5", "useTabs": false, "vueIndentScriptAndStyle": true, "tailwindFunctions": ["tv"], "importOrder": ["", "", "", "", "^[.]"] } ``` It will then instal the necessary dependencies and format your code. ## shortcuts The shortcuts command allows you to add the `shortcuts` composables to your project. ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest shortcuts ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest shortcuts ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest shortcuts ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest shortcuts ``` :: This will create a `shortcuts.ts` file in your `composables` directory. # Starters ## Counter ![Counter Starter Image](https://ui-thing-starter.behonbaker.com/__og-image__/image/og.png){.border} [Live Demo](https://ui-thing-starter.behonbaker.com/){rel=""nofollow""} • [Github Repo](https://github.com/BayBreezy/ui-thing-starter){rel=""nofollow""} The counter starter is a Nuxt app with UI Thing already initialized. ### Features - **Pinia** - A state management library for Vue/Nuxt - **Es Lint** - Nuxt eslint installed and configured - **Prettier** - Code formatter for consistent style - **Commit Lint** - Lint your commit messages - **Husky** - Git hooks for linting - **Lint Staged** - Lint staged files before commit # Shortcuts ## Credits I just want to say that this composable is coming directly from [Nuxt UI](https://ui.nuxt.com/){rel=""nofollow""}. I am not the creator of this composable, I just wanted to share it with you because I think it's a really cool feature to have in your project. You can find the original docs here: [Nuxt UI - Shortcuts](https://ui.nuxt.com/composables/define-shortcuts){rel=""nofollow""}. > Thanks Nuxt UI ♥ ## `defineShortcuts` The `defineShortcuts` composable allows you to define keyboard shortcuts in your app really easily. Try it out by pressing `Ctrl + v` :shortcuts-ex-one ```vue [ShortcutsExOne.vue] ``` ## API ### `defineShortcuts(config: ShortcutsConfig, options?: ShortcutsOptions)` Define keyboard shortcuts for your application. - `config`: An object where keys are shortcut definitions and values are either handler functions or shortcut configuration objects. - `options`: Optional configuration for the shortcuts behavior. - `chainDelay`: The delay between key presses to consider the shortcut as chained. Default is `250`. Shortcuts keys are written as the literal keyboard key value. For a complete list of available shortcut keys, refer to the [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values){rel=""nofollow""} API documentation. Note that the key should be written in lowercase. #### Shortcut Definition Shortcuts are defined using the following format: - Single key: `a`, `b`, `1`, `?`, etc. - Key combinations: Use `_` to separate keys, e.g., `meta_k`, `ctrl_shift_f` - Key sequences: Use `-` to define a sequence, e.g., `g-d` #### Modifiers - `meta`: Represents `⌘ Command` on macOS and `Ctrl` on other platforms - `ctrl`: Represents `Ctrl` on all platforms - `shift`: Used for alphabetic keys when Shift is required #### Special Keys - `escape`: Triggers on Esc key - `enter`: Triggers on Enter key - `arrowleft`, `arrowright`, `arrowup`, `arrowdown`: Trigger on respective arrow keys Examples of keys: - `escape`: will trigger by hitting `Esc` - `meta_k`: will trigger by hitting `⌘` and `K` at the same time on MacOS, and `Ctrl` and `K` on Windows and Linux - `ctrl_k`: will trigger by hitting `Ctrl` and `K` at the same time on MacOS, Windows and Linux - `shift_e`: will trigger by hitting `Shift` and `E` at the same time on MacOS, Windows and Linux - `?`: will trigger by hitting ? on some keyboard layouts, or for example Shift and /, which results in ? on US Mac keyboards - `g-d`: will trigger by hitting `g` then `d` with a maximum delay of 800ms by default - `arrowleft`: will trigger by hitting `←` (also: `arrowright`, `arrowup`, `arrowdown`) ### Shortcut Configuration Each shortcut can be defined as a function or an object with the following properties: ```ts interface ShortcutConfig { handler: () => void; usingInput?: boolean | string; } ``` - `handler`: Function to be executed when the shortcut is triggered - `usingInput`: - `false` (default): Shortcut only triggers when no input is focused - `true`: Shortcut triggers even when any input is focused - `string`: Shortcut only triggers when the specified input (by name) is focused ### `usingInput` Prop: `usingInput?: string | boolean` By default, `usingInput` is `false`, meaning it will only trigger when no input is focused. When set to `true`, the shortcut will also trigger when any input is focused. For a more advanced behavior, `usingInput` can be set to the name of an input, so it only triggers when focusing this specific input. ::prose-show-case :shortcuts-ex-two #code ```vue [ShortcutsExTwo.vue] ``` :: ### Simple shortcut In case the shortcut does not need any config, it can be written as a function. :shortcuts-ex-three ```vue [ShortcutsExThree.vue] ``` ## `useKbd` To get the OS specific meta key symbol, you can use the `useKbd` composable. ```vue ``` *`metaSymbol` will display either `⌘` on MacOS or `Ctrl` on any other OS* # MCP Server ## What it gives you The UI Thing MCP server exposes the library in a way that is useful to agents: - small discovery indexes for components, blocks, docs, examples, and page templates - exact detail tools for full source code and markdown docs - install-plan tools for mixed selections - scaffold-first planning tools for new Nuxt projects This matters because UI Thing is a copy-paste library. The files are the product, so the MCP server is designed to help agents find the right files, dependencies, and docs before implementation. ## Available resources These resources are intentionally compact indexes: - `resource://uithing/components` - `resource://uithing/blocks` - `resource://uithing/documentation-pages` - `resource://uithing/examples` - `resource://uithing/page-templates` - `resource://uithing/quick-start` - `resource://uithing/design-patterns` Use the detail tools when you need full source or full markdown. ## Available tools ### Discovery - `list-components` - `list-blocks` - `list-documentation-pages` - `list-block-pages` - `search-components` - `search-documentation-pages` - `resolve-library-item` ### Details - `get-component` - `get-block` - `get-documentation-page` ### Planning - `get-project-setup` - `get-install-plan` - `plan-page` - `plan-form` - `validate-dependencies`:br Compatibility alias for `get-install-plan` ## Available prompts - `setup-project` - `build-page` - `create-form` - `implement-component` - `create-documentation` - `fix-component-issue` - `optimize-accessibility` Prompts now point to the tools above instead of trying to embed the whole workflow in prompt text. ## Recommended workflow For a new Nuxt project: 1. Call `get-project-setup` 2. Call `plan-page` or `plan-form` 3. Call `resolve-library-item` if the target names are fuzzy 4. Call `get-install-plan` 5. Call `get-component`, `get-block`, or `get-documentation-page` ## Codex Codex does not read `.vscode/mcp.json`. Add MCP servers with `codex mcp add` or by editing `~/.codex/config.toml`. ### Recommended entries - `nuxtMcpToolkit`:br Reference docs server for current Nuxt guidance - `uiThingLocal`:br Local development server for authoring and testing - `uiThingHosted`:br Hosted production endpoint for end-user flows ### CLI setup ```bash codex mcp add nuxtMcpToolkit --url https://mcp-toolkit.nuxt.dev/mcp codex mcp add uiThingLocal --url http://localhost:3000/mcp codex mcp add uiThingHosted --url https://uithing.com/mcp ``` ### Manual config ```toml [~/.codex/config.toml] [mcp_servers.nuxtMcpToolkit] url = "https://mcp-toolkit.nuxt.dev/mcp" [mcp_servers.uiThingLocal] url = "http://localhost:3000/mcp" [mcp_servers.uiThingHosted] url = "https://uithing.com/mcp" ``` ## VS Code If you are using VS Code MCP support, add UI Thing alongside the Nuxt MCP Toolkit docs server: ```json [.vscode/mcp.json] { "servers": { "Nuxt MCP Toolkit": { "type": "http", "url": "https://mcp-toolkit.nuxt.dev/mcp" }, "UI Thing": { "type": "http", "url": "https://uithing.com/mcp" } }, "inputs": [] } ``` For local development, switch the UI Thing URL to `http://localhost:3000/mcp`. ## Cursor ```json [~/.cursor/mcp.json] { "mcpServers": { "ui-thing": { "type": "http", "url": "https://uithing.com/mcp" } } } ``` ## Claude Desktop ```json [claude_desktop_config.json] { "mcpServers": { "ui-thing": { "command": "npx", "args": ["mcp-remote", "https://uithing.com/mcp"] } } } ``` ## Windsurf ```json [.codeium/windsurf/mcp_config.json] { "mcpServers": { "ui-thing": { "type": "http", "url": "https://uithing.com/mcp" } } } ``` ## Example requests ```sh "Set up UI Thing in a new Nuxt app" ``` ```sh "Plan a landing page using UI Thing blocks" ``` ```sh "Build an install plan for button, dialog, and Hero 1" ``` ```sh "Resolve the best UI Thing match for a date picker" ``` ```sh "Fetch the full Button component source and docs" ``` ```sh "Search the documentation for sidebar persistence" ``` # Changelog The changelog has moved to [/changelog](https://uithing.com/changelog), where you can filter by category, search with the command palette, and subscribe via RSS. # Cards :page-ex-cards # Dashboard ::div{.not-prose.border.rounded-lg.overflow-hidden} :block-dashboards4 :: # Landing Page :page-ex-landing # Schema Visualizer :page-ex-schema-visualizer # All Components :page-components-search # Accordion ## Source code Click :source-code-link{component="Accordion"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Anatomy Pass a list of `items` to the component. ```vue [Accordion Anatomy.vue] lines ``` Or use each part individually ```vue [Accordion Anatomy.vue] lines ``` ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add accordion ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add accordion ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add accordion ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add accordion ``` :: ## Usage ### Basic The most common way to use the accordion is by just passing an array of items to the `items` prop. Each item should have a `value`, `title`, and `content`. ::prose-show-case :docs-accordion #code ```vue [DocsAccordion.vue] ``` :: ### Custom styling If you want to change the way that the items look, you can do so by using the different components that the accordion is composed of. ::prose-show-case :docs-accordion-variant #code ```vue [DocsAccordionVariant.vue] ``` :: ### Custom icon You can change the `icon` that is displayed based on the open state of an item. Just override the the `trigger` slot and then override the `icon` slot. ::prose-show-case :docs-accordion-icon #code ```vue [DocsAccordionIcon.vue] ``` :: ## Origin UI Examples These are some examples that I found today over here [Origin UI](https://originui.com/accordions){rel=""nofollow""}. I think they are cool. To use these examples you will have to copy the code and adjust it for your own use. ### With Chevron ::prose-show-case :docs-accordion-with-chevron #code ```vue [DocsAccordionWithChevron.vue] ``` :: ### With Chevron Left ::prose-show-case :docs-accordion-with-chevron-left #code ```vue [DocsAccordionWithChevronLeft.vue] ``` :: ### With Chevron & Icon ::prose-show-case :docs-accordion-with-chevron-icon #code ```vue [DocsAccordionWithChevronIcon.vue] ``` :: ### With Sub-Header & Chevron ::prose-show-case :docs-accordion-with-chevron-sub-header #code ```vue [DocsAccordionWithChevronSubHeader.vue] ``` :: ### With Icon, Sub-Header & Chevron ::prose-show-case :docs-accordion-with-chevron-sub-header-icon #code ```vue [DocsAccordionWithChevronSubHeaderIcon.vue] ``` :: ### Tabs with Chevron ::prose-show-case :docs-accordion-tabs-with-chevron #code ```vue [DocsAccordionTabsWithChevron.vue] ``` :: ### Tabs with Left Chevron ::prose-show-case :docs-accordion-tabs-with-chevron-left #code ```vue [DocsAccordionTabsWithChevronLeft.vue] ``` :: ### Table with Chevron ::prose-show-case :docs-accordion-table-with-chevron #code ```vue [DocsAccordionTableWithChevron.vue] ``` :: ### Table with Left Chevron ::prose-show-case :docs-accordion-table-with-chevron-left #code ```vue [DocsAccordionTableWithChevronLeft.vue] ``` :: ### Multi-Level ::prose-show-case :docs-accordion-multi-level #code ```vue [DocsAccordionMultiLevel.vue] ``` :: ## API Reference ### Accordion Root :prose-component-api{path="app/components/Ui/Accordion/Accordion.vue" sections="props,slots,events,exposed"} ### Accordion Content :prose-component-api{path="app/components/Ui/Accordion/Content.vue" sections="props,slots,events,exposed"} ### Accordion Header :prose-component-api{path="app/components/Ui/Accordion/Header.vue" sections="props,slots,events,exposed"} ### Accordion Item :prose-component-api{path="app/components/Ui/Accordion/Item.vue" sections="props,slots,events,exposed"} ### Accordion Trigger :prose-component-api{path="app/components/Ui/Accordion/Trigger.vue" sections="props,slots,events,exposed"} # Alert ## Source code Click :source-code-link{component="Alert"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add alert ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add alert ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add alert ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add alert ``` :: ## Usage ### Basic ::prose-show-case :docs-alert #code ```vue [DocsAlert.vue] ``` :: ### Destructive ::prose-show-case :docs-alert-destructive #code ```vue [DocsAlertDestructive.vue] ``` :: ### Border ::prose-show-case :docs-alert-border #code ```vue [DocsAlertBorder.vue] ``` :: ## Origin UI Examples These are some examples that I found today over here [Origin UI](https://originui.com/alerts-notifications-banners){rel=""nofollow""}. I think they are cool. To use these examples you will have to copy the code and adjust it for your own use. ### Warning ::prose-show-case :docs-alert-warning #code ```vue [DocsAlertWarning.vue] ``` :: ### Warning Outline ::prose-show-case :docs-alert-warning-outline #code ```vue [DocsAlertWarningOutline.vue] ``` :: ### Error ::prose-show-case :docs-alert-error #code ```vue [DocsAlertError.vue] ``` :: ### Error Outline ::prose-show-case :docs-alert-error-outline #code ```vue [DocsAlertErrorOutline.vue] ``` :: ### Info ::prose-show-case :docs-alert-info #code ```vue [DocsAlertInfo.vue] ``` :: ### Info Outline ::prose-show-case :docs-alert-info-outline #code ```vue [DocsAlertInfoOutline.vue] ``` :: ### Success ::prose-show-case :docs-alert-success #code ```vue [DocsAlertSuccess.vue] ``` :: ### Success Outline ::prose-show-case :docs-alert-success-outline #code ```vue [DocsAlertSuccessOutline.vue] ``` :: ### End Link ::prose-show-case :docs-alert-end-link #code ```vue [DocsAlertEndLink.vue] ``` :: ### Sub Data ::prose-show-case :docs-alert-sub-data #code ```vue [DocsAlertSubData.vue] ``` :: ### Close Button ::prose-show-case :docs-alert-close-button #code ```vue [DocsAlertCloseButton.vue] ``` :: ## Notifications ### Close Button w/ Undo ::prose-show-case :docs-alert-notification-single-button #code ```vue [DocsAlertNotificationSingleButton.vue] ``` :: ### Double Button ::prose-show-case :docs-alert-notification-double-button #code ```vue [DocsAlertNotificationDoubleButton.vue] ``` :: ### Success Learn More ::prose-show-case :docs-alert-notification-success-more #code ```vue [DocsAlertNotificationSuccessMore.vue] ``` :: ### Privacy ::prose-show-case :docs-alert-notification-privacy #code ```vue [DocsAlertNotificationPrivacy.vue] ``` :: ### Version Update ::prose-show-case :docs-alert-notification-version #code ```vue [DocsAlertNotificationVersion.vue] ``` :: ### Mentioned ::prose-show-case :docs-alert-notification-mention #code ```vue [DocsAlertNotificationMention.vue] ``` :: ## API Reference ### Alert :prose-component-api{path="app/components/Ui/Alert/Alert.vue" sections="props,slots,events,exposed"} ### Alert Description :prose-component-api{path="app/components/Ui/Alert/Description.vue" sections="props,slots,events,exposed"} ### Alert Title :prose-component-api{path="app/components/Ui/Alert/Title.vue" sections="props,slots,events,exposed"} # Alert Dialog ## Source code Click :source-code-link{component="AlertDialog"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add alert-dialog ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add alert-dialog ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add alert-dialog ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add alert-dialog ``` :: ## Usage ### Simple ::prose-show-case :docs-alert-dialog #code ```vue [DocsAlertDialog.vue] ``` :: ### Stacked Left ::prose-show-case :docs-alert-dialog-stacked-left #code ```vue [DocsAlertDialogStackedLeft.vue] ``` :: ### Media ::prose-show-case :docs-alert-dialog-media #code ```vue [DocsAlertDialogMedia.vue] ``` :: ### Alert w/ Icon ::prose-show-case :docs-alert-dialog-with-icon #code ```vue [DocsAlertDialogWithIcon.vue] ``` :: # Animated Tooltip ## Source code Click :source-code-link{component="AnimatedTooltip.vue"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add animated-tooltip ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add animated-tooltip ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add animated-tooltip ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add animated-tooltip ``` :: ## Anatomy Pass a list of `items` to the component. Each item should contain an image, title, and optionally a description. ```vue [AnimatedTooltip Anatomy.vue] ``` ## Usage ### Basic Display a group of avatars with animated tooltips that appear on hover. The tooltips follow mouse movement with smooth spring animations. ::prose-show-case :docs-animated-tooltip #code ```vue [DocsAnimatedTooltip.vue] ``` :: ### Without Description You can omit the description field to show only the title in the tooltip. ::prose-show-case :docs-animated-tooltip-no-description #code ```vue [DocsAnimatedTooltipNoDescription.vue] ``` :: ### Large Group The component works well with larger groups of people. The avatars automatically stack with negative margin. ::prose-show-case :docs-animated-tooltip-large #code ```vue [DocsAnimatedTooltipLarge.vue] ``` :: ## Features - **Dynamic Animation**: Tooltips animate in with smooth spring physics using Motion V - **Mouse Tracking**: Tooltips rotate and translate based on mouse position for a natural feel - **Auto-generated IDs**: If no ID is provided, the component automatically generates unique IDs - **Flexible Content**: Support for title and optional description in tooltips - **Stacked Layout**: Avatars stack with negative margin for a compact group display - **Hover Effects**: Smooth scale and z-index transitions on hover ## Props The component accepts an `items` prop with the following interface: ```ts interface Item { id?: string; // Optional: Auto-generated if not provided title: string; // Required: Displayed in tooltip description?: string; // Optional: Secondary text in tooltip image: string; // Required: Avatar image URL } ``` ## Customization You can customize the component by modifying the styles directly in the component file: - **Avatar size**: Change `size-14` class on the image element - **Tooltip styling**: Modify the tooltip container classes - **Animation parameters**: Adjust `stiffness` and `damping` in the Motion component - **Gradient colors**: Update the `via-emerald-500` and `via-sky-500` classes for different accent colors # Aspect Ratio ## Source code Click :source-code-link{component="AspectRatio"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add aspect-ratio ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add aspect-ratio ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add aspect-ratio ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add aspect-ratio ``` :: ## Usage Right click the image to perform different actions. ::prose-show-case :docs-aspect-ratio #code ```vue [DocsAspectRatio.vue] ``` :: # Attachment ## Source code Click :source-code-link{component="Attachment"} to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use. ## Installation ::prose-code-group{hide-header-meta no-format sync="_pm"} ```bash [npm] icon="material-icon-theme:npm" noFormat hideHeader npx ui-thing@latest add attachment ``` ```bash [pnpm] icon="material-icon-theme:pnpm" noFormat hideHeader pnpm dlx ui-thing@latest add attachment ``` ```bash [bun] icon="material-icon-theme:bun" noFormat hideHeader bun x ui-thing@latest add attachment ``` ```bash [yarn] icon="material-icon-theme:yarn" noFormat hideHeader yarn dlx ui-thing@latest add attachment ``` :: ## Usage 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. ::prose-show-case :docs-attachment-demo #code ```vue [DocsAttachmentDemo.vue] ``` :: ## Anatomy ```vue [Attachment Anatomy.vue] lines ``` Wrap multiple attachments in `UiAttachmentGroup` to lay them out in a scrollable, snapping row. ## Features - Icon and image media through `UiAttachmentMedia` - 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 `UiAttachmentTrigger` that opens a link or dialog while the actions stay independently clickable - Scrollable, snapping `UiAttachmentGroup` with an edge fade - Every part renders through `Primitive`, so `as` / `as-child` and Vue `class` overrides work on any part ## Examples ### Image Set `variant="image"` on `UiAttachmentMedia` and render an `` inside it. Use `orientation="vertical"` to stack the media above the content. ::prose-show-case :docs-attachment-image-demo #code ```vue [DocsAttachmentImageDemo.vue] ``` :: ### States Set `state` to reflect the upload lifecycle. `uploading` and `processing` shimmer the title, and `error` switches to a destructive treatment. ::prose-show-case :docs-attachment-states-demo #code ```vue [DocsAttachmentStatesDemo.vue] ``` :: ### Sizes Use `size` to switch between `default`, `sm`, and `xs`. ::prose-show-case :docs-attachment-sizes-demo #code ```vue [DocsAttachmentSizesDemo.vue] ``` :: ### Group Wrap attachments in `UiAttachmentGroup` to lay them out in a horizontally scrollable, snapping row with an edge fade. ::prose-show-case :docs-attachment-group-demo #code ```vue [DocsAttachmentGroupDemo.vue] ``` :: ### Trigger Add an `UiAttachmentTrigger` to make the whole card open a link or dialog. It fills the card behind the actions, so the actions stay clickable. ::prose-show-case :docs-attachment-trigger-demo #code ```vue [DocsAttachmentTriggerDemo.vue] ``` :: ## Accessibility `UiAttachmentAction` renders a [`Button`](https://uithing.com/docs/components/button), and `UiAttachmentTrigger` renders a real `