Add salad_ui
to your mix.exs
def deps do
[
{:salad_ui, "~> 0.13.0"},
]
end
Using salad_ui
as part of your project:
This way you can install only components that you want to use or you want to edit SaladUI's component source code to fit your need. If you just want to use SaladUI's components, see Using as library below.
#> cd your_project
#> mix salad.init
3. **Using `salad_ui` as a library:**
- Init Salad UI in your project with option `--as-lib`
- Using in your project
defmodule MyModule do
import SaladUI.Button
def render(_) do
~H"""
<.button>Click me</.button>
"""
end
end
## More configuration
1. Custom error translate function
```elixir
config :salad_ui, :error_translator_function, {MyAppWeb.CoreComponents, :translate_error}
Here is how to start develop SaladUI on local machine.
https://github.com/bluzky/salad_storybook
in the same directory with Salad UIcd salad_storybook
mix phx.server
In your project folder make sure the dependencies are installed by running mix deps.get
, then once completed you can run:
mix test
to run tests once or,mix test.watch
to watch file and run tests on file changes.To run the failing tests only, just run mix test.watch --stale
.
It's also important to note that you must format your code with mix format
before sending a pull request, otherwise the build in github will fail.
This project could not be available without these awesome works:
tailwind css
an awesome css utility projectturboprop
I borrow code from here for merging tailwinds classesshadcn/ui
which this project is inspired fromPhoenix Framework
of course