Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: Docs on Custom themes / components for CLI #4793

Open
2 tasks done
dylandignan opened this issue Sep 9, 2024 · 1 comment
Open
2 tasks done

[feat]: Docs on Custom themes / components for CLI #4793

dylandignan opened this issue Sep 9, 2024 · 1 comment

Comments

@dylandignan
Copy link

Feature description

As mentioned in https://x.com/shadcn/status/1831771732690215413, you can have your own registry to distribute custom themes or components.

I have looked at the code and can reverse engineer how we might be able to do this ourselves, but it's not clear exactly what all is required for setup. I see that it's all JSON files in the registry which turn into code, but some things like https://ui.shadcn.com/r/styles/default/toast.json have import type {\n ToastActionElement,\n ToastProps,\n} from \"@/registry/default/ui/toast\" which that registry/default seems to be substituted at runtime.

Additionally, it's not clear what the side effects are of each ItemType (

export const registryItemTypeSchema = z.enum([
"registry:style",
"registry:lib",
"registry:example",
"registry:block",
"registry:component",
"registry:ui",
"registry:hook",
"registry:theme",
"registry:page",
])
).

It would be nice to have a more curated set of documentation which explained how folks can use this to write their own registries and use the shadcn cli to distribute their own code. Simple examples like https://raw.githubusercontent.com/mindtown-ai/dynamic-prompt/main/schema.json make sense, but not when intra-registry components start to come in to play.

Affected component/components

No response

Additional Context

Additional details here...

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues and PRs
@lklyne
Copy link

lklyne commented Sep 24, 2024

This would be helpful! I've been looking for an approach to adjust the spacing within a theme. The demo video shows this but can't find any documentation on how it's accomplished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants