Registries
Understanding and utilizing registries in your project.
Registries in shadxn
are centralized repositories where UI components are stored and managed. They serve as a hub from which you can add, update, or manage components within your projects. By using registries, shadxn
enables you to maintain a modular and scalable architecture for your development process.
What is a Registry?
A registry is essentially a URL that points to a collection of components. These components can be easily imported into your project using the shadxn
CLI. Registries can be official, hosted by the project maintainers, or custom, allowing for greater flexibility and personalization in your development workflow.
Available Registries
shadxn
supports multiple registries, including:
-
Shadcn Registry: Hosted at ui.shadcn.com, this is the official registry containing a wide range of components developed and maintained by the
shadcn
team. -
Shadxn Registry: Available at ui.shadxn.com, this registry extends the official set with additional components and features specific to
shadxn
.
Adding an External Registry
If you have an external registry or have created your own collection of components, shadxn
allows you to add this registry to your project. This enables you to use custom components seamlessly alongside those from the official registries.
To add an external registry, use the following command:
shadxn registry add registry-name
You will be prompted to enter the URL of the registry. This action registers the external source with your project, making its components available for use.
Using Components from a Newly Added Registry
Once you've added a new registry, you can begin using its components immediately. For example, to add a button
component from your newly added registry, run:
shadxn add button -r your-registry-name
This command fetches the button
component from the specified registry and integrates it into your project.
Registries are a powerful feature of shadxn
, offering flexibility and control over the components you use in your projects. By understanding how to add and utilize both official and external registries, you can tailor your development environment to suit your specific needs and preferences.