Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sites/docs/src/content/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Options:
-h, --help display help for command
```

## build
## registry build

Use the `build` command to generate the registry JSON files.
Use the `registry build` command to generate the registry JSON files.

<PMExecute command="shadcn-svelte@next registry build [registry.json]" />

Expand Down
2 changes: 2 additions & 0 deletions sites/docs/src/content/migration/tailwind-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ It's here! Tailwind v4 and Svelte 5. Ready for you to try out. You can start usi
<Button variant="outline" size="sm" target="_blank" href="https://v4.shadcn-svelte.com">See Demo</Button>
</div>

This documentation site is now running Tailwind v4. If you're looking for the old Tailwind v3 docs, you can find them here: [https://tw3.shadcn-svelte.com](https://tw3.shadcn-svelte.com).

## What's New

- The `@next` CLI can now initialize projects with Tailwind v4 and Svelte 5.
Expand Down
11 changes: 4 additions & 7 deletions sites/docs/src/content/registry/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide will walk you through the process of setting up your own component re

It assumes you already have a project with components and would like to turn it into a registry.

If you're starting a new registry project, you can use the [TODO: registry template](https://github.com/huntabyte/scn-svelte-registry-template) as a starting point. We have already configured it for you.
If you're starting a new registry project, you can use the [registry template](https://github.com/huntabyte/shadcn-svelte/tree/next-tailwind-4/registry-template) as a starting point. It's already configured for you.

## registry.json

Expand Down Expand Up @@ -98,7 +98,7 @@ To add your component to the registry, you need to add your component definition
"description": "A simple hello world component.",
"files": [
{
"path": "registry/hello-world/hello-world.svelte",
"path": "./src/lib/hello-world/hello-world.svelte",
"type": "registry:component"
}
]
Expand Down Expand Up @@ -147,7 +147,7 @@ Run the build script to generate the registry JSON files.

**Note:** By default, the build script will generate the registry JSON files in `static/r` e.g `static/r/hello-world.json`.

You can change the output directory by passing the `--output` option. See the [shadcn-svelte registry build command](/docs/cli#build) for more information.
You can change the output directory by passing the `--output` option. See the [shadcn-svelte registry build command](/docs/cli#registry-build) for more information.

</Callout>

Expand Down Expand Up @@ -183,11 +183,8 @@ Use the secure token to authenticate requests and return a 401 Unauthorized resp

Here are some guidelines to follow when building components for a registry.

- Place your registry item in the `registry/[NAME]` directory. It can be anything you want as long as it's nested under the `registry` directory.
- The following properties are required for the block definition: `name`, `description`, `type` and `files`.
- Make sure to list all registry dependencies in `registryDependencies`. A registry dependency is the name of the component in the registry eg. `input`, `button`, `card`, etc or a URL to a registry item eg. `http://localhost:5173/r/editor.json`.
- Make sure to list all dependencies in `dependencies`. A dependency is the name of the package in the registry eg. `zod`, `sonner`, etc. To set a version, you can use the `name@version` format eg. `zod@^3.20.0`.
- **Imports should always use the `$lib/registry` path.** eg. `import HelloWorld from "$lib/registry/hello-world/hello-world.svelte"`
- Make sure to list all registry dependencies in `registryDependencies`. A registry dependency is the name of the component in the registry eg. `input`, `button`, `card`, etc or a URL to a registry item eg. `http://localhost:5173/r/editor.json`
- Ideally, place your files within a registry item in `components`, `hooks`, `lib` directories.

## Install using the CLI
Expand Down
4 changes: 2 additions & 2 deletions sites/docs/src/content/registry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ out to us](https://github.com/huntabyte/shadcn-svelte/discussions).

</Callout>

You can use the `shadcn-svelte` CLI to run your own component registry. Running your own registry allows you to distribute your custom components, hooks, pages, and other files to any Svelte project.
You can use the `shadcn-svelte` CLI to create your own component registry. Creating your own registry allows you to distribute your own custom components, hooks, pages, and other files to any Svelte project.

Registry items are automatically compatible with the `shadcn-svelte` CLI.

Expand All @@ -27,4 +27,4 @@ If you'd like to see an example of a registry, we have a [template project](http

You can clone it using `degit`

<PMExecute command="degit huntabyte/shadcn-svelte/registry-template" />
<PMExecute command="degit huntabyte/shadcn-svelte/registry-template#next-tailwind-4" />
Comment thread
huntabyte marked this conversation as resolved.
1 change: 1 addition & 0 deletions sites/docs/src/styles/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

[data-rehype-pretty-code-figure] {
position: relative;
width: 100%;
}

[data-rehype-pretty-code-figure] code {
Expand Down