### Display Custom Documentation on Install
Source: https://www.shadcn-svelte.com/docs/registry/registry-item-json
Provide a custom message to the user when the registry item is installed via the CLI using the `docs` property. This is useful for reminding users of necessary setup steps.
```json
{
"docs": "Remember to add the FOO_BAR environment variable to your .env file."
}
```
--------------------------------
### Install Navigation Menu with bun
Source: https://www.shadcn-svelte.com/docs/components/navigation-menu
Install the navigation-menu component using bun.
```bash
bun x shadcn-svelte@latest add navigation-menu
```
--------------------------------
### Install Native Select with bun
Source: https://www.shadcn-svelte.com/docs/components/native-select
Install the native-select component using bun.
```bash
bun x shadcn-svelte@latest add native-select
```
--------------------------------
### Install Sheet Component (bun)
Source: https://www.shadcn-svelte.com/docs/components/sheet
Install the Sheet component using bun.
```bash
bun x shadcn-svelte@latest add sheet
```
--------------------------------
### Install Resizable Component
Source: https://www.shadcn-svelte.com/docs/components/resizable
Install the Resizable component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add resizable
```
```bash
npx shadcn-svelte@latest add resizable
```
```bash
bun x shadcn-svelte@latest add resizable
```
--------------------------------
### Install Select Component with npx
Source: https://www.shadcn-svelte.com/docs/components/select
Install the Select component using the npx command.
```bash
npx shadcn-svelte@latest add select
```
--------------------------------
### Install Navigation Menu with npx
Source: https://www.shadcn-svelte.com/docs/components/navigation-menu
Install the navigation-menu component using npx.
```bash
npx shadcn-svelte@latest add navigation-menu
```
--------------------------------
### Install Native Select with npx
Source: https://www.shadcn-svelte.com/docs/components/native-select
Install the native-select component using npx.
```bash
npx shadcn-svelte@latest add native-select
```
--------------------------------
### Install Input Component
Source: https://www.shadcn-svelte.com/docs/components/input
Install the Input component using npm, pnpm, or bun.
```bash
pnpm dlx shadcn-svelte@latest add input
```
```bash
npx shadcn-svelte@latest add input
```
```bash
bun x shadcn-svelte@latest add input
```
--------------------------------
### Install Navigation Menu with pnpm
Source: https://www.shadcn-svelte.com/docs/components/navigation-menu
Install the navigation-menu component using pnpm.
```bash
pnpm dlx shadcn-svelte@latest add navigation-menu
```
--------------------------------
### Install Command Component with bun
Source: https://www.shadcn-svelte.com/docs/components/command
Installs the Command component using bun.
```bash
bun x shadcn-svelte@latest add command
```
--------------------------------
### Install Native Select with pnpm
Source: https://www.shadcn-svelte.com/docs/components/native-select
Install the native-select component using pnpm.
```bash
pnpm dlx shadcn-svelte@latest add native-select
```
--------------------------------
### Install Tooltip Component
Source: https://www.shadcn-svelte.com/docs/components/tooltip
Installs the tooltip component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add tooltip
```
```bash
npx shadcn-svelte@latest add tooltip
```
```bash
bun x shadcn-svelte@latest add tooltip
```
--------------------------------
### Install Sheet Component (npx)
Source: https://www.shadcn-svelte.com/docs/components/sheet
Install the Sheet component using npx.
```bash
npx shadcn-svelte@latest add sheet
```
--------------------------------
### Install Pagination with npx
Source: https://www.shadcn-svelte.com/docs/components/pagination
Installs the Pagination component using the npx command.
```bash
npx shadcn-svelte@latest add pagination
```
--------------------------------
### Install Select Component with bun
Source: https://www.shadcn-svelte.com/docs/components/select
Install the Select component using the bun package manager.
```bash
bun x shadcn-svelte@latest add select
```
--------------------------------
### Install shadcn-svelte Skill with bun
Source: https://www.shadcn-svelte.com/docs/skills
Use this command to install the shadcn-svelte skill into your project using bun. Once installed, your AI assistant will automatically load it when working with shadcn-svelte components.
```bash
bun x skills add huntabyte/shadcn-svelte
```
--------------------------------
### Install Toggle Component
Source: https://www.shadcn-svelte.com/docs/components/toggle
Install the Toggle component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add toggle
```
```bash
npx shadcn-svelte@latest add toggle
```
```bash
bun x shadcn-svelte@latest add toggle
```
--------------------------------
### Install Progress Component with BUN
Source: https://www.shadcn-svelte.com/docs/components/progress
Installs the Progress component using the BUN runtime.
```bash
bun x shadcn-svelte@latest add progress
```
--------------------------------
### Install Drawer Component
Source: https://www.shadcn-svelte.com/docs/components/drawer
Install the Drawer component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add drawer
```
```bash
npx shadcn-svelte@latest add drawer
```
```bash
bun x shadcn-svelte@latest add drawer
```
--------------------------------
### Install Popover with npx
Source: https://www.shadcn-svelte.com/docs/components/popover
Install the Popover component using the npx command.
```bash
npx shadcn-svelte@latest add popover
```
--------------------------------
### Install Command Component with npx
Source: https://www.shadcn-svelte.com/docs/components/command
Installs the Command component using npx.
```bash
npx shadcn-svelte@latest add command
```
--------------------------------
### Install Calendar Component
Source: https://www.shadcn-svelte.com/docs/components/calendar
Instructions for installing the Calendar component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add calendar
```
```bash
npx shadcn-svelte@latest add calendar
```
```bash
bun x shadcn-svelte@latest add calendar
```
--------------------------------
### Install tw-animate-css with bun
Source: https://www.shadcn-svelte.com/docs/migration/tailwind-v4
Install the `tw-animate-css` package as a dev dependency using bun.
```bash
bun install tw-animate-css -D
```
--------------------------------
### Install Toggle Group with bun
Source: https://www.shadcn-svelte.com/docs/components/toggle-group
Installs the Toggle Group component using bun.
```bash
bun x shadcn-svelte@latest add toggle-group
```
--------------------------------
### Install Pagination with bun
Source: https://www.shadcn-svelte.com/docs/components/pagination
Installs the Pagination component using the bun package manager.
```bash
bun x shadcn-svelte@latest add pagination
```
--------------------------------
### Install Toggle Group with npx
Source: https://www.shadcn-svelte.com/docs/components/toggle-group
Installs the Toggle Group component using npx.
```bash
npx shadcn-svelte@latest add toggle-group
```
--------------------------------
### Install Select Component with pnpm
Source: https://www.shadcn-svelte.com/docs/components/select
Install the Select component using the pnpm package manager.
```bash
pnpm dlx shadcn-svelte@latest add select
```
--------------------------------
### Install Progress Component with NPX
Source: https://www.shadcn-svelte.com/docs/components/progress
Installs the Progress component using the NPX command.
```bash
npx shadcn-svelte@latest add progress
```
--------------------------------
### Install Label Component
Source: https://www.shadcn-svelte.com/docs/components/label
Install the Label component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add label
```
```bash
npx shadcn-svelte@latest add label
```
```bash
bun x shadcn-svelte@latest add label
```
--------------------------------
### Install Popover with bun
Source: https://www.shadcn-svelte.com/docs/components/popover
Install the Popover component using the bun package manager.
```bash
bun x shadcn-svelte@latest add popover
```
--------------------------------
### Install Accordion with bun
Source: https://www.shadcn-svelte.com/docs/components/accordion
Installs the Accordion component using the bun package manager.
```bash
bun x shadcn-svelte@latest add accordion
```
--------------------------------
### Basic Menubar Setup
Source: https://www.shadcn-svelte.com/docs/components/menubar
Import the Menubar components from '$lib/components/ui/menubar/index.js' to begin using the Menubar.
```svelte
```
--------------------------------
### Carousel API Setup Placeholder
Source: https://www.shadcn-svelte.com/docs/components/carousel
A minimal example showing the setup for binding the carousel API using `setApi`. This is useful for initializing API-dependent logic.
```svelte
(api = emblaApi)}>
...
...
...
```
--------------------------------
### Run the development server
Source: https://www.shadcn-svelte.com/docs/registry/getting-started
Starts the development server to serve your registry files locally. Your registry will be accessible at `http://localhost:5173/r/[NAME].json`.
```bash
pnpm run dev
```
```bash
npm run dev
```
```bash
bun run dev
```
--------------------------------
### Initialize shadcn-svelte Project
Source: https://www.shadcn-svelte.com/docs/cli
Use the `init` command to set up your project with shadcn-svelte. It installs dependencies, adds the `cn` utility, and configures CSS variables. You will be prompted to answer configuration questions.
```bash
pnpm dlx shadcn-svelte@latest init
```
```bash
npx shadcn-svelte@latest init
```
```bash
bun x shadcn-svelte@latest init
```
--------------------------------
### Avatar Component Examples
Source: https://www.shadcn-svelte.com/docs/components/avatar
Demonstrates different ways to use the Avatar component, including a basic setup, a rounded variant, and a stacked display with styling.
```svelte
```
--------------------------------
### Vertical Carousel Example
Source: https://www.shadcn-svelte.com/docs/components/carousel
Demonstrates how to configure a carousel to display vertically using the `orientation` prop. Includes basic setup with imported components and a loop of items.
```svelte
{#each Array(5) as _, i (i)}
{i + 1}
{/each}
```
--------------------------------
### Basic Command Menu with Icons and Shortcuts
Source: https://www.shadcn-svelte.com/docs/components/command
A comprehensive example demonstrating a command menu with suggestions and settings groups. It includes icons for items and shortcuts for settings.
```svelte
No results found.
Calendar
Search Emoji
Calculator
Profile
P
Billing
B
Settings
S
```
--------------------------------
### Basic Usage Setup
Source: https://www.shadcn-svelte.com/docs/components/empty
Importing the necessary components for basic usage of the Empty component.
```svelte
```
--------------------------------
### Advanced Collapsible with Icons and Button Variants
Source: https://www.shadcn-svelte.com/docs/components/collapsible
An example demonstrating a more complex Collapsible component setup, including icons and styled buttons for the trigger. This is suitable for interactive elements within a larger UI.
```svelte
@huntabyte starred 3 repositories
Toggle
@huntabyte/bits-ui
@melt-ui/melt-ui
@sveltejs/svelte
```
--------------------------------
### Install Collapsible with pnpm
Source: https://www.shadcn-svelte.com/docs/components/collapsible
Use this command to install the Collapsible component using pnpm. Ensure you have pnpm installed and configured for your project.
```bash
pnpm dlx shadcn-svelte@latest add collapsible
```
--------------------------------
### Install Registry Item with Bun
Source: https://www.shadcn-svelte.com/docs/registry/getting-started
Use this command to install a registry item using the shadcn-svelte CLI with Bun. Ensure you have Bun installed.
```bash
bun x shadcn-svelte@latest add http://localhost:5173/r/hello-world.json
```
--------------------------------
### Basic Context Menu Setup
Source: https://www.shadcn-svelte.com/docs/components/context-menu
Sets up a basic context menu with a trigger and a few simple menu items. Import the necessary components from the library.
```svelte
```
```svelte
Right click
Profile
Billing
Team
Subscription
```
--------------------------------
### Install Registry Item with PNPM
Source: https://www.shadcn-svelte.com/docs/registry/getting-started
Use this command to install a registry item using the shadcn-svelte CLI with PNPM. Ensure you have PNPM installed.
```bash
pnpm dlx shadcn-svelte@latest add http://localhost:5173/r/hello-world.json
```
--------------------------------
### Install Registry Item with NPX
Source: https://www.shadcn-svelte.com/docs/registry/getting-started
Use this command to install a registry item using the shadcn-svelte CLI with NPX. This is a common method if you have Node.js and npm installed.
```bash
npx shadcn-svelte@latest add http://localhost:5173/r/hello-world.json
```
--------------------------------
### shadcn-svelte init Configuration Prompts
Source: https://www.shadcn-svelte.com/docs/cli
These are the interactive prompts you will see when running `shadcn-svelte init`. They guide you through configuring essential project settings like base color, global CSS path, and import aliases.
```txt
Which base color would you like to use? Slate
Where is your global CSS file? (this file will be overwritten) src/routes/layout.css
Configure the import alias for lib: $lib
Configure the import alias for components: $lib/components
Configure the import alias for utils: $lib/utils
Configure the import alias for hooks: $lib/hooks
Configure the import alias for ui: $lib/components/ui
```
--------------------------------
### Install shadcn-svelte Skill with npx
Source: https://www.shadcn-svelte.com/docs/skills
Use this command to install the shadcn-svelte skill into your project using npx. Once installed, your AI assistant will automatically load it when working with shadcn-svelte components.
```bash
npx skills add huntabyte/shadcn-svelte
```
--------------------------------
### Install shadcn-svelte Skill with pnpm
Source: https://www.shadcn-svelte.com/docs/skills
Use this command to install the shadcn-svelte skill into your project using pnpm. Once installed, your AI assistant will automatically load it when working with shadcn-svelte components.
```bash
pnpm dlx skills add huntabyte/shadcn-svelte
```
--------------------------------
### Install tailwindcss-animate
Source: https://www.shadcn-svelte.com/docs/migration/svelte-5
Install the `tailwindcss-animate` package using your preferred package manager.
```bash
pnpm i tailwindcss-animate
```
```bash
npm i tailwindcss-animate
```
```bash
bun install tailwindcss-animate
```
--------------------------------
### shadcn-svelte init Command Options
Source: https://www.shadcn-svelte.com/docs/cli
Available options for the `shadcn-svelte init` command. These allow for customization of the initialization process, such as specifying the working directory, overwriting files, or disabling dependency installation.
```bash
Usage: shadcn-svelte init [options]
initialize your project and install dependencies
Options:
-c, --cwd the working directory (default: the current directory)
-o, --overwrite overwrite existing files (default: false)
--no-deps disable adding & installing dependencies
--skip-preflight ignore preflight checks and continue (default: false)
--base-color the base color for the components (choices: "slate", "gray", "zinc",
"neutral", "stone")
--css path to the global CSS file
--components-alias import alias for components
--lib-alias import alias for lib
--utils-alias import alias for utils
--hooks-alias import alias for hooks
--ui-alias import alias for ui
--proxy fetch items from registry using a proxy
-h, --help display help for command
```
--------------------------------
### Simple Menubar Example
Source: https://www.shadcn-svelte.com/docs/components/menubar
A basic Menubar with a 'File' menu containing 'New Tab', 'New Window', 'Share', and 'Print' items. This example demonstrates the fundamental structure of a Menubar.
```svelte
File
New Tab
T
New Window
Share
Print
```
--------------------------------
### Install Context Menu Component
Source: https://www.shadcn-svelte.com/docs/components/context-menu
Installs the context menu component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add context-menu
```
```bash
npx shadcn-svelte@latest add context-menu
```
```bash
bun x shadcn-svelte@latest add context-menu
```
--------------------------------
### Install Sheet Component (pnpm)
Source: https://www.shadcn-svelte.com/docs/components/sheet
Install the Sheet component using pnpm.
```bash
pnpm dlx shadcn-svelte@latest add sheet
```
--------------------------------
### Install Icon Library
Source: https://www.shadcn-svelte.com/docs/installation/manual
Install the `@lucide/svelte` package for icon support. Use the command appropriate for your package manager.
```bash
pnpm i @lucide/svelte
```
```bash
npm i @lucide/svelte
```
```bash
bun install @lucide/svelte
```
--------------------------------
### Install Aspect Ratio Component with npx
Source: https://www.shadcn-svelte.com/docs/components/aspect-ratio
Install the Aspect Ratio component using the npx command.
```bash
npx shadcn-svelte@latest add aspect-ratio
```
--------------------------------
### Install Checkbox with npx
Source: https://www.shadcn-svelte.com/docs/components/checkbox
Install the Checkbox component using the npx command.
```bash
npx shadcn-svelte@latest add checkbox
```
--------------------------------
### Render a Switch Component
Source: https://www.shadcn-svelte.com/docs/components/switch
A minimal example demonstrating how to render the Switch component.
```svelte
```
--------------------------------
### Install Accordion with npx
Source: https://www.shadcn-svelte.com/docs/components/accordion
Installs the Accordion component using the npx command.
```bash
npx shadcn-svelte@latest add accordion
```
--------------------------------
### Basic Command Menu Structure
Source: https://www.shadcn-svelte.com/docs/components/command
A minimal example showing the basic structure of the Command component, including input, list, empty state, groups, and items.
```svelte
No results found.
Calendar
Search Emoji
Calculator
Profile
Billing
Settings
```
--------------------------------
### Install tw-animate-css with npm
Source: https://www.shadcn-svelte.com/docs/migration/tailwind-v4
Install the `tw-animate-css` package as a dev dependency using npm.
```bash
npm i tw-animate-css -D
```
--------------------------------
### Install tw-animate-css with pnpm
Source: https://www.shadcn-svelte.com/docs/migration/tailwind-v4
Install the `tw-animate-css` package as a dev dependency using pnpm.
```bash
pnpm i tw-animate-css -D
```
--------------------------------
### Install Tabs Component with npx
Source: https://www.shadcn-svelte.com/docs/components/tabs
Installs the Tabs component using the npx command.
```bash
npx shadcn-svelte@latest add tabs
```
--------------------------------
### Install Aspect Ratio Component with bun
Source: https://www.shadcn-svelte.com/docs/components/aspect-ratio
Install the Aspect Ratio component using the bun package manager.
```bash
bun x shadcn-svelte@latest add aspect-ratio
```
--------------------------------
### Basic Select Usage
Source: https://www.shadcn-svelte.com/docs/components/select
A minimal example demonstrating the basic structure for using the Select component. It includes importing the necessary components and setting up the root, trigger, and content elements.
```svelte
```
```svelte
Light
Dark
System
```
--------------------------------
### Install Slider Component
Source: https://www.shadcn-svelte.com/docs/components/slider
Install the Slider component using pnpm, npx, or bun.
```bash
pnpm dlx shadcn-svelte@latest add slider
```
```bash
npx shadcn-svelte@latest add slider
```
```bash
bun x shadcn-svelte@latest add slider
```
--------------------------------
### Basic Chart Setup with LayerChart
Source: https://www.shadcn-svelte.com/docs/components/chart
Demonstrates the fundamental structure for using the Chart component with LayerChart, including data and tooltip integration.
```svelte
{#snippet tooltip()}
{/snippet}
```
--------------------------------
### Install Spinner Component
Source: https://www.shadcn-svelte.com/docs/components/spinner
Install the Spinner component using your preferred package manager.
```bash
pnpm dlx shadcn-svelte@latest add spinner
```
```bash
npx shadcn-svelte@latest add spinner
```
```bash
bun x shadcn-svelte@latest add spinner
```
--------------------------------
### Install Hover Card with bun
Source: https://www.shadcn-svelte.com/docs/components/hover-card
Installs the Hover Card component using the bun package runner.
```bash
bun x shadcn-svelte@latest add hover-card
```