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

Change default ui directory #1156

Closed
riccardolardi opened this issue Aug 9, 2023 · 19 comments
Closed

Change default ui directory #1156

riccardolardi opened this issue Aug 9, 2023 · 19 comments
Assignees
Labels
area: cli enhancement New feature or request Stale
Milestone

Comments

@riccardolardi
Copy link

Is it possible to change the default ui directory? I'd like the CLI to install new components into @/components/ui-library instead of @/components/ui. Thanks

@mohamedaleya
Copy link

mohamedaleya commented Aug 9, 2023

According to CLI docs, there's a -p (or --path) option that should do the trick, however after testing it, that didn't work. It keeps installing the component in the /src/components/ui folder.

Here's what I have tried:

npx shadcn-ui add --path /src/components/ui-library alert
npx shadcn-ui add --path /src/components/ui-library alert
npx shadcn-ui add -p /ui-library alert

https://ui.shadcn.com/docs/cli
brave_QlhsvsdATn

There exist many issues related to this bug if you need more info. Here's one of them:
#848 (comment)

@shadcn
Copy link
Collaborator

shadcn commented Aug 9, 2023

This is something I'm looking into. It's currently hardcoded to UI but definitely something that we'll make configurable. Assigning this to me.

@shadcn shadcn added enhancement New feature or request area: cli labels Aug 9, 2023
@shadcn shadcn self-assigned this Aug 9, 2023
@Stefandasbach
Copy link

Any update on this @shadcn?

@shadcn
Copy link
Collaborator

shadcn commented Sep 22, 2023

@Stefandasbach I haven't had time to look into it yet. For now, as a workaround, you can provide --path when adding components.

-p, --path <path>  the path to add the component to.

@mindofjonas
Copy link

Looks like this still isn't working with npx shadcn-ui add <component> --path <path> either.

@nopitown
Copy link

The workaround doesn't work as well :( I hope this option is enabled soon so adoption for existing projects is easier.

@claudfuen
Copy link

Bumping this up, would love to be able to configure a default path on components.json for CLI to reference

@datproto
Copy link

Bump this again, really need this kind of feature

2 similar comments
@artemshchirov
Copy link

Bump this again, really need this kind of feature

@dinwwwh
Copy link

dinwwwh commented Dec 1, 2023

Bump this again, really need this kind of feature

@rogerrc12
Copy link

Hoping to have this soon

@claudfuen
Copy link

Bumping again pls add

@josephdburdick
Copy link

Change the path setting in the components.json then run the cli again.

@victorharry
Copy link

Any update on this @shadcn?

@joemcbroom
Copy link

@shadcn I know you're busy but I tracked down the line which seems to be blocking the workaround
I hesitate to open a PR for it though since it's there for a reason I guess?

if (override && item.type !== "components:ui") {

@shadcn
Copy link
Collaborator

shadcn commented Dec 18, 2023

Update: Back from vacation. Working on this now.

@joemcbroom
Copy link

@shadcn if it's a simple fix but you don't have time to work on it, let me know I'd love to sync on it and be able to contribute. And I'm on PTO this week so have the time :)

@schulzf
Copy link

schulzf commented Jan 8, 2024

#2266 closes this

@shadcn shadcn added the Stale label Mar 1, 2024
@shadcn
Copy link
Collaborator

shadcn commented Mar 5, 2024

Yes. I believe this is fixed #2266. Please reopen if not. Thank you.

@shadcn shadcn closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests