### Install Parity Dependencies Source: https://github.com/axadrn/shadcn-templ/blob/main/parity/README.md Initial setup command to install dependencies for the parity harness. ```bash cd parity && npm install && npx playwright install chromium ``` -------------------------------- ### Install the CLI from working tree Source: https://github.com/axadrn/shadcn-templ/blob/main/CONTRIBUTING.md Installs the CLI binary from the local working tree using `go install`. ```bash go install ./cmd/shadcn-templ ``` -------------------------------- ### Installation (CLI) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/empty.md Command to install the Empty component using the CLI. ```APIDOC ## [CLI] Install Empty Component ### Description Install the Empty component using the shadcn-templ CLI. ### Command shadcn-templ add empty ``` -------------------------------- ### Start the development environment Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/monorepo.md Navigate to the project directory and start the development server using Task. ```shell cd my-app go mod tidy task dev ``` -------------------------------- ### Install shadcn-templ CLI with go install Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/cli.md Installs the CLI globally using the Go toolchain. The CLI installs the Go way and updates itself the same way. ```shell go install github.com/axadrn/shadcn-templ/v2/cmd/shadcn-templ@latest ``` -------------------------------- ### Install CLI and run shadcn-templ init Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/import-workflow.md Installs the shadcn-templ CLI and runs `init` to create `assets/css/globals.css` and merge theme variables and base layer. ```shell go install github.com/axadrn/shadcn-templ/v2/cmd/shadcn-templ@latest shadcn-templ init ``` -------------------------------- ### Installation Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/aspect-ratio.md Command to install the aspect-ratio component using the shadcn-templ CLI. ```APIDOC ## Installation ### Command ```bash shadcn-templ add aspect-ratio ``` ``` -------------------------------- ### Installation Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/input.md Command to add the Input component to your project. ```APIDOC ## Installation ### Command ```bash shadcn-templ add input ``` ``` -------------------------------- ### Installation - Manual Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/textarea.md Manual installation steps for the Textarea component, including copying the component source and updating import paths. ```APIDOC ## [Manual] Installation Steps ### Description Manually install the Textarea component by copying the source code and updating import paths. ### Steps 1. Copy and paste the following code into your project. 2. Update the import paths to match your project setup. ### Component Source components/textarea/textarea.templ ### JavaScript Component scripts are loaded through the shared script bundle, see JavaScript documentation. ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/kbd.md Command to install the Kbd component using the shadcn-templ CLI. ```APIDOC ## Install Kbd Component ### Description Install the Kbd component using the shadcn-templ CLI. ### Command ```bash shadcn-templ add kbd ``` ``` -------------------------------- ### Usage Example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/navigation-menu.md Example of importing and using the NavigationMenu component in a templ file. ```APIDOC ## [templ] NavigationMenu Usage ### Description Demonstrates how to import and use the NavigationMenu component in a templ template. ### Import import "github.com/axadrn/shadcn-templ/v2/components/navigationmenu" ### Example @navigationmenu.NavigationMenu() { @navigationmenu.List() { @navigationmenu.Item() { @navigationmenu.Trigger() { Item One } @navigationmenu.Content() { @navigationmenu.Link() { Link } } } } } ``` -------------------------------- ### Install templui 2.0 beta with go install Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/changelog/2026-08-templui-2-0.md Install the beta version of templui 2.0 using the go install command. This is a beta release, so if something looks off, open an issue. ```shell go install github.com/axadrn/shadcn-templ/v2/cmd/templui@latest ``` -------------------------------- ### Initialize project with CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Install the CLI and initialize a new project with the templ preset. ```shell go install github.com/axadrn/shadcn-templ/v2/cmd/shadcn-templ@latest shadcn-templ init -t templ ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/accordion.md Command to install the Accordion component using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add accordion ### Description Installs the Accordion component into your project using the shadcn-templ CLI. ### Command shadcn-templ add accordion ### Usage Run this command in your terminal to add the Accordion component to your project. ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/switch.md Command to install the Switch component using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add switch ### Description Installs the Switch component into your project using the shadcn-templ command-line tool. ### Method CLI ### Endpoint shadcn-templ add switch ### Parameters None ### Request Example ```bash shadcn-templ add switch ``` ### Response #### Success Response Component files added to the project. #### Response Example No structured response. ``` -------------------------------- ### Installation Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/label.md Command to install the Label component using the shadcn-templ CLI. ```APIDOC ## Installation ### Command ```bash shadcn-templ add label ``` ``` -------------------------------- ### Install Drawer with CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/drawer.md Use this command to install the Drawer component via the CLI. ```bash shadcn-templ add drawer ``` -------------------------------- ### Full registry-item.json example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Complete example of a registry item with name, registryDependencies, files, type, and meta. Served at /r/styles/{style}/{name}.json and by /init. ```json { "$schema": "https://shadcn-templ.com/schema/registry-item.json", "name": "accordion", "registryDependencies": ["icon"], "files": [ { "path": "components/accordion/accordion.templ", "content": "...", "type": "registry:ui" }, { "path": "components/accordion/accordion.js", "content": "...", "type": "registry:ui" } ], "type": "registry:ui", "meta": { "links": { "docs": "https://shadcn-templ.com/docs/components/accordion" } } } ``` -------------------------------- ### Installation (CLI) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/collapsible.md Command to install the Collapsible component using the shadcn-templ CLI. ```APIDOC ## [CLI] Install Collapsible ### Description Install the Collapsible component using the shadcn-templ CLI. ### Method CLI ### Command shadcn-templ add collapsible ### Example ```bash shadcn-templ add collapsible ``` ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/native-select.md Command to add the native-select component to your project. ```APIDOC ## [CLI] shadcn-templ add native-select ### Description Adds the native-select component to your project. ### Command shadcn-templ add native-select ``` -------------------------------- ### Installation (CLI) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/separator.md Command to install the Separator component using the shadcn-templ CLI. ```APIDOC ## Installation ### Command ```bash shadcn-templ add separator ``` ``` -------------------------------- ### Run Development Server Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Start the development environment using the configured task. ```shell task dev ``` -------------------------------- ### Scaffold a new project with shadcn-templ init -t templ Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/cli.md Starts a new project by passing a template and a project name. The example uses the templ template. ```shell shadcn-templ init my-app -t templ ``` -------------------------------- ### Install card component with CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/card.md Installs the card component using the CLI. Run this command in your project directory. ```bash shadcn-templ add card ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toggle.md Command to install the Toggle component using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add toggle ### Description Installs the Toggle component into your project. ### Command shadcn-templ add toggle ``` -------------------------------- ### Installation Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/radio-group.md Command to install the radio-group component. ```APIDOC ## Installation ### Command ```bash shadcn-templ add radio-group ``` ``` -------------------------------- ### Usage Example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/empty.md Example of importing and using the Empty component in a templ file. ```APIDOC ## [Usage] Empty Component ### Description Example of using the Empty component with its sub-components. ### Import import "github.com/axadrn/shadcn-templ/v2/components/empty" ### Example @empty.Empty() { @empty.Header() { @empty.Media(empty.MediaProps{Variant: empty.MediaVariantIcon}) { @icon.FolderOpen() } @empty.Title() { No data } @empty.Description() { No data found } } @empty.Content() { @button.Button() { Add data } } } ``` -------------------------------- ### Usage Example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/native-select.md Example of importing and using the NativeSelect component with options. ```APIDOC ## [Go] Import ### Description Import the nativeselect package. ### Code import "github.com/axadrn/shadcn-templ/v2/components/nativeselect" ## [Templ] Usage ### Description Render a native select with options. ### Code @nativeselect.NativeSelect() { @nativeselect.Option(nativeselect.OptionProps{Value: ""}) { Select a fruit } @nativeselect.Option(nativeselect.OptionProps{Value: "apple"}) { Apple } @nativeselect.Option(nativeselect.OptionProps{Value: "banana"}) { Banana } } ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/tooltip.md Command to add the Tooltip component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add tooltip ### Description Adds the Tooltip component to your project. ### Command shadcn-templ add tooltip ### Usage Run this command in your project directory to install the Tooltip component. ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/checkbox.md Command to install the Checkbox component using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add checkbox ### Description Installs the Checkbox component into your project using the shadcn-templ CLI. ### Method CLI ### Command shadcn-templ add checkbox ### Response No response body. The command installs the component files. ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/textarea.md Command to add the Textarea component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add textarea ### Description Adds the Textarea component to your project. ### Command shadcn-templ add textarea ### Usage Run this command in your terminal to install the component. ``` -------------------------------- ### Usage Example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/table.md Example of using the Table component in a templ file. ```APIDOC ## [Usage] Table Component Example ### Description Demonstrates how to compose a table using the table package components. ### Code Example @table.Table() { @table.Caption() { A list of your recent invoices. } @table.Header() { @table.Row() { @table.Head(table.HeadProps{Class: "w-[100px]"}) { Invoice } @table.Head() { Status } @table.Head() { Method } @table.Head(table.HeadProps{Class: "text-right"}) { Amount } } } @table.Body() { @table.Row() { @table.Cell(table.CellProps{Class: "font-medium"}) { INV001 } @table.Cell() { Paid } @table.Cell() { Credit Card } @table.Cell(table.CellProps{Class: "text-right"}) { $250.00 } } } } ``` -------------------------------- ### Install progress component via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/progress.md Installs the progress component using the CLI. ```bash shadcn-templ add progress ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/table.md Command to add the Table component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add table ### Description Adds the Table component to your project. ### Command shadcn-templ add table ### Usage Run this command in your terminal to install the Table component. ``` -------------------------------- ### Install Resizable component Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/resizable.md Run this command to add the Resizable component to your project. ```bash shadcn-templ add resizable ``` -------------------------------- ### Manual Installation Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/switch.md Steps to manually copy and paste the Switch component code into your project. ```APIDOC ## [MANUAL] Copy and paste component code ### Description Manually install the Switch component by copying the provided source code into your project and updating import paths. ### Method Manual ### Endpoint N/A ### Parameters None ### Request Example Copy the component source from the documentation. ### Response #### Success Response Component files added to the project. #### Response Example No structured response. ``` -------------------------------- ### Run Development Environment Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Navigate to the project directory and start the development environment using Taskfile. ```shell cd templ-app go mod tidy task dev ``` -------------------------------- ### Install Item via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/item.md Use the shadcn-templ CLI to add the item component to your project. ```bash shadcn-templ add item ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/badge.md Command to add the Badge component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add badge ### Description Adds the Badge component to your project using the shadcn-templ CLI. ### Command shadcn-templ add badge ### Usage Run this command in your terminal to install the Badge component. ``` -------------------------------- ### Add components to an app Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/monorepo.md Navigate to the app directory and use the add command to install components. ```shell cd apps/web ``` ```shell shadcn-templ add [COMPONENT] ``` -------------------------------- ### Install NativeSelect via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/native-select.md Use the shadcn-templ CLI to add the component to your project. ```bash shadcn-templ add native-select ``` -------------------------------- ### Install Pagination via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/pagination.md Use the shadcn-templ CLI to add the pagination component to your project. ```bash shadcn-templ add pagination ``` -------------------------------- ### Installation (CLI) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/button.md Command to add the Button component to your project using the shadcn-templ CLI. ```APIDOC ## Installation ### Command ```bash shadcn-templ add button ``` ``` -------------------------------- ### Install Switch via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/switch.md Use the shadcn-templ CLI to add the switch component to your project. ```bash shadcn-templ add switch ``` -------------------------------- ### registry.json full schema example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-json.md Complete example of the registry.json schema, showing the required $schema, name, homepage, and items properties with an accordion item. ```json { "$schema": "https://shadcn-templ.com/schema/registry.json", "name": "shadcn-templ", "homepage": "https://shadcn-templ.com", "items": [ { "name": "accordion", "type": "registry:ui", "title": "Accordion", "description": "Collapsible accordion component.", "registryDependencies": ["icon"], "files": [ { "path": "components/accordion/accordion.templ", "type": "registry:ui" }, { "path": "components/accordion/accordion.js", "type": "registry:ui" } ], "categories": ["layout-navigation"] } ] } ``` -------------------------------- ### Install dependencies Source: https://github.com/axadrn/shadcn-templ/blob/main/CONTRIBUTING.md Downloads Go module dependencies required for the project. ```bash go mod download ``` -------------------------------- ### Install Menubar via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/menubar.md Use the shadcn-templ CLI to add the Menubar component to your project. ```bash shadcn-templ add menubar ``` -------------------------------- ### Install Toast via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toast.md Use the shadcn-templ CLI to add the toast component to your project. ```bash shadcn-templ add toast ``` -------------------------------- ### Installation - CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/dialog.md Command to add the Dialog component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add dialog ### Description Adds the Dialog component to your project. ### Command shadcn-templ add dialog ### Parameters None ### Response No response body. ``` -------------------------------- ### Start development watchers Source: https://github.com/axadrn/shadcn-templ/blob/main/plans/parity-components.md Commands to start the templ watcher, bundle watcher, Tailwind CSS compiler, and Shiki service on a specific port. ```bash PORT=8190 BASE_URL=http://localhost:8190 go tool templ generate --watch --cmd="go run ./cmd/docs/main.go" go run ./cmd/shadcn-templ bundle --watch tailwindcss -i ./assets/css/globals.css -o ./assets/css/output.css --watch=always export TEMPL_URL=http://localhost:8190 ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toast.md Command to add the toast component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add toast ### Description Adds the toast component to your project. ### Method CLI command ### Command shadcn-templ add toast ### Response No response body. ``` -------------------------------- ### Create Project Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Initialize a new Go module if you do not have one. ```shell mkdir myapp && cd myapp go mod init myapp ``` -------------------------------- ### Installation (CLI) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/popover.md Command to add the Popover component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add popover ### Description Adds the Popover component to your project. ### Command shadcn-templ add popover ### Parameters None ### Response No response body. ``` -------------------------------- ### Install Button Dependency Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/attachment.md Install the required button dependency for the manual installation process. ```bash shadcn-templ add button ``` -------------------------------- ### Setup Shadcn Reference App Source: https://github.com/axadrn/shadcn-templ/blob/main/parity/README.md Commands to clone, build, and serve the shadcn reference application for comparison. ```bash git clone https://github.com/shadcn-ui/ui tmp/parity-runtime/reference cd tmp/parity-runtime/reference && git checkout pnpm install && pnpm --filter=v4 registry:build parity/reference-next.sh # build once, then serve on 3100 parity/reference-next.sh start # serve an existing build ``` -------------------------------- ### Create Taskfile Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Pin templ and the CLI as Go tools. ```shell go get -tool github.com/a-h/templ/cmd/templ go get -tool github.com/axadrn/shadcn-templ/v2/cmd/shadcn-templ ``` -------------------------------- ### Package components.json Configuration Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/monorepo.md Example configuration for the shared UI package components.json file. ```json { "$schema": "https://shadcn-templ.com/schema/components.json", "style": "base-nova", "tailwind": { "css": "styles/globals.css", "baseColor": "neutral", "cssVariables": true }, "iconLibrary": "lucide", "aliases": { "components": "my-app/packages/ui/components", "utils": "my-app/packages/ui/utils", "ui": "my-app/packages/ui/components" } } ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/navigation-menu.md Command to add the navigation-menu component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add navigation-menu ### Description Adds the navigation-menu component to your project. ### Command shadcn-templ add navigation-menu ### Usage Run this command in your terminal to install the component. ``` -------------------------------- ### Install Skeleton via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/skeleton.md Use the shadcn-templ CLI to add the Skeleton component to your project. ```bash shadcn-templ add skeleton ``` -------------------------------- ### Configure templ, Tailwind CSS and Task Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Install the required CLI tools for templ and Task. ```shell go install github.com/a-h/templ/cmd/templ@latest go install github.com/go-task/task/v3/cmd/task@latest ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/spinner.md Command to add the Spinner component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add spinner ### Description Adds the Spinner component to your project. ### Command shadcn-templ add spinner ### Usage Run this command in your terminal to install the Spinner component. ``` -------------------------------- ### Install Tooltip via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/tooltip.md Use the shadcn-templ CLI to add the tooltip component to your project. ```bash shadcn-templ add tooltip ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/skeleton.md Command to add the Skeleton component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add skeleton ### Description Adds the Skeleton component to your project. ### Command shadcn-templ add skeleton ### Parameters None ### Response No response body. ``` -------------------------------- ### dependencies property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Specifies Go module dependencies with @version syntax. ```json { "dependencies": ["github.com/axadrn/shadcn-templ/v2@latest"] } ``` -------------------------------- ### shadcn-templ init usage and options Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/cli.md Shows the full usage and options for the init command, including arguments and flags such as --template, --monorepo, --preset, --base-color, --css, --force, --silent, --registry, and --cwd. ```shell Usage: shadcn-templ init [name] [--template ] [--monorepo] [--preset ] [--base-color ] [--css ] [--force] [--silent] [--registry ] Arguments: name the project name for --template and --monorepo (default templ-app, templ-monorepo) Options: -t, --template scaffold a new project from a template (templ) --monorepo scaffold a monorepo project (implies --template templ) -p, --preset use a preset configuration (code, URL or name) --base-color override the base color --css path to your Tailwind CSS entry file -f, --force force overwrite of existing configuration -s, --silent mute output --registry registry URL (default https://shadcn-templ.com, env SHADCN_TEMPL_REGISTRY) -c, --cwd the working directory (default ".") ``` -------------------------------- ### Install Toggle via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toggle.md Use the shadcn-templ CLI to add the toggle component to your project. ```bash shadcn-templ add toggle ``` -------------------------------- ### Usage of Item component Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/item.md Example of how to structure the Item component with Media, Content, and Actions. ```templ @item.Item() { @item.Media(item.MediaProps{Variant: item.MediaVariantIcon}) { @icon.Star() } @item.Content() { @item.Title() { Title } @item.Description() { Description } } @item.Actions() { @button.Button() { Action } } } ``` -------------------------------- ### Install Calendar via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/calendar.md Use the shadcn-templ CLI to add the calendar component to your project. ```bash shadcn-templ add calendar ``` -------------------------------- ### Install Alert via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/alert.md Use the shadcn-templ CLI to add the alert component to your project. ```bash shadcn-templ add alert ``` -------------------------------- ### Install sidebar via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/sidebar.md Use the shadcn-templ CLI to add the sidebar component to your project. ```bash shadcn-templ add sidebar ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/alert.md Command to add the Alert component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add alert ### Description Adds the Alert component to your project. ### Command shadcn-templ add alert ### Usage Run this command in your project root to install the Alert component. ``` -------------------------------- ### Initialize project with presets Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Initialize a project using a specific design preset code or a named preset. ```shell shadcn-templ init -t templ --preset b2D0wqNxT shadcn-templ init -t templ --preset vega ``` -------------------------------- ### Usage - Templ Example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/tooltip.md Example of using the Tooltip component in a templ template. ```APIDOC ## [templ] Tooltip Usage Example ### Description Demonstrates how to use the Tooltip component with a trigger button and content. ### Code @tooltip.Tooltip() { @tooltip.Content() {

Add to library

} } ``` -------------------------------- ### Install Marker via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/marker.md Use the shadcn-templ CLI to add the marker component to your project. ```bash shadcn-templ add marker ``` -------------------------------- ### Usage (Templ Example) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/popover.md Example of using the Popover component in a templ template. ```APIDOC ## [Templ] Popover Usage Example ### Description Demonstrates how to use the Popover component with a trigger button and content. ### Code @popover.Popover() { @button.Button(button.Props{ Variant: button.VariantOutline, Attributes: popover.Trigger(ctx), }) { Open Popover } @popover.Content() { @popover.Header() { @popover.Title() { Title } @popover.Description() { Description text here. } } } } ### Parameters None ### Response No response body. ``` -------------------------------- ### Install Combobox via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/combobox.md Use the shadcn-templ CLI to add the combobox component to your project. ```bash shadcn-templ add combobox ``` -------------------------------- ### Install Textarea via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/textarea.md Use the shadcn-templ CLI to add the textarea component to your project. ```bash shadcn-templ add textarea ``` -------------------------------- ### Kbd Component Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/kbd.md Example of importing and using the Kbd component in a templ file. ```APIDOC ## Kbd Component Usage ### Description Import the Kbd component and use it to display a keyboard key. ### Import ```go import "github.com/axadrn/shadcn-templ/v2/components/kbd" ``` ### Usage Example ```templ @kbd.Kbd() { Ctrl } ``` ``` -------------------------------- ### Configure and Run Local Preview App Source: https://github.com/axadrn/shadcn-templ/blob/main/parity/README.md Commands to start the local templ preview application and set the required environment variable. ```bash PORT=8190 BASE_URL=http://localhost:8190 go tool templ generate --watch --cmd="go run ./cmd/docs/main.go" export TEMPL_URL=http://localhost:8190 ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/hover-card.md Command to add the hover-card component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add hover-card ### Description Adds the hover-card component to your project. ### Command shadcn-templ add hover-card ### Parameters None. ``` -------------------------------- ### Install Label via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/label.md Use the shadcn-templ CLI to add the label component to your project. ```bash shadcn-templ add label ``` -------------------------------- ### Initialize Project with Preset Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Use the generated command from the shadcn-templ/create tool to initialize your project with your selected preset options. ```shell shadcn-templ init -t templ --preset [CODE] ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toggle-group.md Command to add the toggle-group component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add toggle-group ### Description Adds the toggle-group component to your project. ### Command shadcn-templ add toggle-group ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/slider.md Command to add the slider component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add slider ### Description Adds the slider component to your project. ### Method CLI ### Command shadcn-templ add slider ### Response No response body. ``` -------------------------------- ### Install Badge via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/badge.md Use the shadcn-templ CLI to add the badge component to your project. ```bash shadcn-templ add badge ``` -------------------------------- ### Install Select via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/select.md Use the shadcn-templ CLI to automatically add the Select component to your project. ```bash shadcn-templ add select ``` -------------------------------- ### Install Collapsible via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/collapsible.md Use the shadcn-templ CLI to add the collapsible component to your project. ```bash shadcn-templ add collapsible ``` -------------------------------- ### Install Slider via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/slider.md Use the shadcn-templ CLI to add the slider component to your project. ```bash shadcn-templ add slider ``` -------------------------------- ### Install Separator via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/separator.md Use the shadcn-templ CLI to add the separator component to your project. ```bash shadcn-templ add separator ``` -------------------------------- ### Install carousel via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/carousel.md Use the shadcn-templ CLI to add the carousel component to your project. ```bash shadcn-templ add carousel ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/sheet.md Command to add the Sheet component to a project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add sheet ### Description Adds the Sheet component to your project using the shadcn-templ CLI. ### Method CLI command ### Command shadcn-templ add sheet ### Usage Run this command in your project directory to install the Sheet component. ``` -------------------------------- ### Install Accordion via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/accordion.md Use the shadcn-templ CLI to add the accordion component to your project. ```bash shadcn-templ add accordion ``` -------------------------------- ### Install Checkbox via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/checkbox.md Command to install the Checkbox component using the shadcn-templ CLI. ```bash shadcn-templ add checkbox ``` -------------------------------- ### Run reference app Source: https://github.com/axadrn/shadcn-templ/blob/main/plans/parity-components.md Commands to build and start the shadcn reference application on port 3100. ```bash pnpm install pnpm --filter=v4 registry:build next build next start --port 3100 ``` -------------------------------- ### Install Tabs via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/tabs.md Use the CLI command to add the Tabs component to your project. ```bash shadcn-templ add tabs ``` -------------------------------- ### Install Bubble via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/bubble.md Use the shadcn-templ CLI to add the Bubble component to your project. ```bash shadcn-templ add bubble ``` -------------------------------- ### Install Attachment via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/attachment.md Use the shadcn-templ CLI to add the attachment component to your project. ```bash shadcn-templ add attachment ``` -------------------------------- ### Install Sheet via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/sheet.md Use the shadcn-templ CLI to add the Sheet component to your project. ```bash shadcn-templ add sheet ``` -------------------------------- ### Install InputGroup via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/input-group.md Use the shadcn-templ CLI to add the input-group component to your project. ```bash shadcn-templ add input-group ``` -------------------------------- ### Commit message example Source: https://github.com/axadrn/shadcn-templ/blob/main/CONTRIBUTING.md Example of a commit message following the convention category(scope or module): message, using the feat category. ```text feat(components): add new prop to the avatar component ``` -------------------------------- ### Install Dialog via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/dialog.md Use the shadcn-templ CLI to add the dialog component to your project. ```bash shadcn-templ add dialog ``` -------------------------------- ### Installation via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/avatar.md Command to add the Avatar component to your project using the shadcn-templ CLI. ```APIDOC ## [CLI] shadcn-templ add avatar ### Description Adds the Avatar component to your project using the shadcn-templ CLI. ### Method CLI ### Command shadcn-templ add avatar ### Response No response body. The command installs the component files into your project. ``` -------------------------------- ### Initialize configuration with shadcn-templ init Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/cli.md Initializes configuration and dependencies for an existing project. Writes components.json, adds the shared utils package, merges theme CSS variables into the Tailwind entry file, and vendors shared stylesheets. Requires a go.mod in the current or parent directory. ```shell shadcn-templ init ``` -------------------------------- ### Use new token classes in a component (templ) Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/theming.md Example usage of the new warning token classes in a templ component. Requires the token to be defined and exposed as shown in the previous CSS example. ```templ
``` -------------------------------- ### window.templ.resizable.getSize Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/resizable.md Gets the current size of a panel. ```APIDOC ## window.templ.resizable.getSize ### Description Gets the current size of a panel. ### Method `window.templ.resizable.getSize(panelId)` ### Parameters - **panelId** (string) - Required - The ID of the panel. ### Response Returns an object with `asPercentage` and `inPixels` properties. ### Example ```js const size = window.templ.resizable.getSize("panel-id") ``` ``` -------------------------------- ### Install Avatar via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/avatar.md Use the CLI command to add the avatar component to your project. ```bash shadcn-templ add avatar ``` -------------------------------- ### Import Component in Templ Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/installation.md Example of importing and using the added Button component in a templ file. ```templ package pages import "myapp/components/button" templ Home() {
@button.Button() { Click me }
} ``` -------------------------------- ### window.templ.resizable.getLayout Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/resizable.md Gets the current layout of a panel group. ```APIDOC ## window.templ.resizable.getLayout ### Description Gets the current layout of a panel group. ### Method `window.templ.resizable.getLayout(groupId)` ### Parameters - **groupId** (string) - Required - The ID of the panel group. ### Response Returns an object keyed by panel ID with percentage sizes. ### Example ```js const layout = window.templ.resizable.getLayout("group-id") ``` ``` -------------------------------- ### description property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Longer description of the registry item. ```json { "description": "Modal dialog for critical confirmations." } ``` -------------------------------- ### title property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Human-readable title for the registry item. ```json { "title": "Alert Dialog" } ``` -------------------------------- ### $schema property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Identifies the shadcn-templ registry-item.json format. ```json { "$schema": "https://shadcn-templ.com/schema/registry-item.json" } ``` -------------------------------- ### Toggle Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/toggle.md Example of using the Toggle component in a templ file. ```APIDOC ## [templ] @toggle.Toggle() { Toggle } ### Description Renders a Toggle component with default settings. ### Code @toggle.Toggle() { Toggle } ``` -------------------------------- ### registryDependencies property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Lists registry dependencies by name or URL. ```json { "registryDependencies": ["button", "icon"] } ``` -------------------------------- ### Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/radio-group.md Example of importing and using the RadioGroup component in a templ file. ```APIDOC ## Usage ### Import ```go import ( "github.com/axadrn/shadcn-templ/v2/components/label" "github.com/axadrn/shadcn-templ/v2/components/radio" ) ``` ### Example ```templ @radiogroup.RadioGroup(radiogroup.Props{Value: "option-one"}) {
@radiogroup.Item(radiogroup.ItemProps{ID: "option-one", Value: "option-one"}) @label.Label(label.Props{For: "option-one"}) { Option One }
@radiogroup.Item(radiogroup.ItemProps{ID: "option-two", Value: "option-two"}) @label.Label(label.Props{For: "option-two"}) { Option Two }
} ``` ``` -------------------------------- ### Install Input component via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/input.md Use the shadcn-templ CLI to add the input component to your project. ```bash shadcn-templ add input ``` -------------------------------- ### Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/separator.md Example of importing and using the Separator component in a Go/Templ project. ```APIDOC ## Usage ### Import ```go import "github.com/axadrn/shadcn-templ/v2/components/separator" ``` ### Render ```templ @separator.Separator() ``` ``` -------------------------------- ### Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/label.md Example of importing and using the Label component in a templ file. ```APIDOC ## Usage ### Import ```go import "github.com/axadrn/shadcn-templ/v2/components/label" ``` ### Example ```templ @label.Label(label.Props{For: "email"}) { Your email address } ``` ``` -------------------------------- ### Carousel with Options Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/carousel.md Example of configuring the carousel with Align and Loop options. ```APIDOC ## Carousel with Options ### Description Configures the carousel using the Align and Loop props. ### Code Example ```templ @carousel.Carousel(carousel.Props{ Align: carousel.AlignStart, Loop: true, }) { @carousel.Content() { @carousel.Item() { ... } @carousel.Item() { ... } @carousel.Item() { ... } } } ``` ``` -------------------------------- ### Basic Avatar usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/avatar.md Example of implementing an Avatar with an image and a fallback. ```templ @avatar.Avatar() { @avatar.Image(avatar.ImageProps{Src: "https://github.com/axadrn.png"}) @avatar.Fallback() { AA } } ``` -------------------------------- ### Render Bubble component Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/bubble.md Example of rendering a Bubble with content and reactions. ```templ @bubble.Bubble() { @bubble.Content() { I checked the registry output and removed the stale route. } @bubble.Reactions() { 👍 } } ``` -------------------------------- ### Initialize an additional app Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/monorepo.md Run the init command within the directory of a new app to join it to the existing monorepo. ```shell shadcn-templ init --cwd apps/admin ``` -------------------------------- ### Install Dropdown Menu via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/dropdown-menu.md Use the shadcn-templ CLI to add the dropdown-menu component to your project. ```bash shadcn-templ add dropdown-menu ``` -------------------------------- ### Skeleton Component Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/skeleton.md Example of using the Skeleton component in a templ file. ```APIDOC ## [TEMPL] @skeleton.Skeleton(skeleton.Props{Class: "h-[20px] w-[100px] rounded-full"}) ### Description Renders a Skeleton component with the specified class. ### Parameters - **Class** (string) - Optional - CSS class string for styling the skeleton. ### Response Renders an animated placeholder block. ``` -------------------------------- ### Import installed components using module path Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/package-imports.md Shows how to import components and utils after configuring aliases. The import paths must live under the module path of your go.mod. ```go import ( "your-app/components/button" "your-app/utils" ) ``` -------------------------------- ### homepage property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-json.md Shows the homepage property of your registry, used for metadata. ```json { "homepage": "https://shadcn-templ.com" } ``` -------------------------------- ### Define chart configuration Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/chart.md Set up the chart configuration object including labels and color tokens in chart_example.templ. ```go var chartConfig = chart.Config{ {Key: "desktop", Label: "Desktop", Color: "#2563eb"}, {Key: "mobile", Label: "Mobile", Color: "#60a5fa"}, } ``` -------------------------------- ### Link Component Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/navigation-menu.md Example of using the Link component with Href and TriggerStyle. ```APIDOC ## [templ] Link Component Usage ### Description Shows how to render a Link as a link with Href and apply TriggerStyle for trigger appearance. ### Example @navigationmenu.Item() { @navigationmenu.Link(navigationmenu.LinkProps{ Href: "/docs", Class: navigationmenu.TriggerStyle(), }) { Documentation } } ``` -------------------------------- ### InputGroupButton variants Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/input-group.md Examples of standard and icon-only buttons within an input group. ```templ @inputgroup.Button() { Button } @inputgroup.Button(inputgroup.ButtonProps{Size: inputgroup.ButtonSizeIconXs, Attributes: templ.Attributes{"aria-label": "Copy"}}) { @icon.Copy() } ``` -------------------------------- ### Install Kbd component via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/kbd.md Use the shadcn-templ CLI to add the Kbd component to your project. ```bash shadcn-templ add kbd ``` -------------------------------- ### Install Context Menu via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/context-menu.md Use the shadcn-templ CLI to add the context-menu component to your project. ```bash shadcn-templ add context-menu ``` -------------------------------- ### Initialize a project with --registry Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/getting-started.md Initializes a project with the specified preset and registry base URL. The SHADCN_TEMPL_REGISTRY environment variable works the same way as the --registry flag. ```shell shadcn-templ init --preset nova --registry http://localhost:8090 ``` -------------------------------- ### Install Navigation Menu via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/navigation-menu.md Use the shadcn-templ CLI to add the navigation menu component to your project. ```bash shadcn-templ add navigation-menu ``` -------------------------------- ### Slider Component Usage Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/slider.md Example of importing and using the Slider component in a templ file. ```APIDOC ## [Component] Slider ### Description Renders a slider input with one draggable thumb per value on a shared track. ### Import import "github.com/axadrn/shadcn-templ/v2/components/slider" ### Usage Example @slider.Slider(slider.Props{Value: []float64{33}, Max: 100, Step: 1}) ### Props - **Value** ([]float64) - Default: [Min, Max] - The current value(s) of the slider. - **Min** (float64) - Default: 0 - The minimum value. - **Max** (float64) - Default: 100 - The maximum value. - **Step** (float64) - Default: 1 - The step increment. - **Orientation** (OrientationHorizontal | OrientationVertical) - Default: OrientationHorizontal - The orientation of the slider. - **Name** (string) - Optional - The name attribute for the input. - **Disabled** (bool) - Default: false - Whether the slider is disabled. - **Class** (string) - Optional - Additional CSS classes. ``` -------------------------------- ### Install Aspect Ratio via CLI Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/components/aspect-ratio.md Use the shadcn-templ CLI to add the aspect-ratio component to your project. ```bash shadcn-templ add aspect-ratio ``` -------------------------------- ### $schema property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-json.md Shows the $schema property that identifies the shadcn-templ registry.json format. ```json { "$schema": "https://shadcn-templ.com/schema/registry.json" } ``` -------------------------------- ### type property example Source: https://github.com/axadrn/shadcn-templ/blob/main/internal/service/content/docs/registry/registry-item-json.md Specifies the type of the registry item, e.g., registry:ui. ```json { "type": "registry:ui" } ```