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

What's the difference between the installation options? #77

Closed
jamauro opened this issue Nov 3, 2024 · 5 comments
Closed

What's the difference between the installation options? #77

jamauro opened this issue Nov 3, 2024 · 5 comments

Comments

@jamauro
Copy link

jamauro commented Nov 3, 2024

Thanks for making salad ui! I think it'd be helpful to clarify what the difference between the two installation options. Why would I choose one over the other?

@bluzky
Copy link
Owner

bluzky commented Nov 4, 2024

Thanks @jamauro I should update document to clarify the different.

  • salad.init --as-lib configure all necessary config to use SaladUI as a library. Before release v0.10 you have to manually copy tailwind config, update app.css, app.js, ... yourself.

  • salad.init would do all works as salad.init --as-lib does, it also copies helper files, setup component directories, ... then you can use salad.add <component> to install (copy) selected component to your project. This way you can customize the component the way you want because those components are parts of your project source code.

Why I make salad.init default to what I explained above. When I started developing SaladUI, I intended to create a collection of component that user just copy and use whichever component they need.

@jamauro
Copy link
Author

jamauro commented Nov 4, 2024

Interesting. If I'm understanding correctly, it sound like when using --as-lib you wouldn't be able to customize the component at all. Good to know. For my use case, it sounds like I don't want to use --as-lib.

Here's what my experience was:

I tried both ways of installing to see if I could understand what the difference was. I tried --as-lib first. After it was done installing, it instructed me to add the components one by one with mix salad.add. My intuition was that with --as-lib I wouldn't need to add each component one by one. It also seemed to be a bit slow when adding each component. It took ~5 seconds to add each one.

So then I tried the other way and it was much faster, nearly instantaneous when adding each component.

@bluzky
Copy link
Owner

bluzky commented Nov 5, 2024

oh my bad, I should update the instruction for mix task. When using --as-lib you don't need to add anything. Just import and use the component, ex: import Salad.Checkbox

@bluzky
Copy link
Owner

bluzky commented Nov 5, 2024

and you can customize the class

@bluzky
Copy link
Owner

bluzky commented Nov 6, 2024

document updated in #81

@bluzky bluzky closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants