- Add
salad_uito yourmix.exs
def deps do
[
{:salad_ui, "~> 1.0.0-beta.3"},
]
end- Choose your installation method:
For a quick start with minimal configuration:
mix salad.setupThis sets up SaladUI to use components directly from the library. You can start using components immediately:
defmodule MyAppWeb.PageLive do
use MyAppWeb, :live_view
import SaladUI.Button
import SaladUI.Dialog
def render(_) do
~H"""
<.button>Click me</.button>
<.dialog id="my-dialog">
<.dialog_content>
<p>Hello world!</p>
</.dialog_content>
</.dialog>
"""
end
endFor full customization with local component files:
# Default installation
mix salad.install
# With custom prefix and color scheme
mix salad.install --prefix MyUI --color-scheme slateThis copies all component files to your project under lib/my_app_web/components/ui/ where you can customize them:
defmodule MyAppWeb.PageLive do
use MyAppWeb, :live_view
import MyAppWeb.Components.UI.Button
import MyAppWeb.Components.UI.Dialog
def render(_) do
~H"""
<.button>Click me</.button>
<.dialog id="my-dialog">
<.dialog_content>
<p>Hello world!</p>
</.dialog_content>
</.dialog>
"""
end
end- β Sets up Tailwind CSS and color schemes
- β Configures JavaScript hooks and components
- β Ready to use immediately
- β Components cannot be customized
- β Uses external package dependencies
- β Sets up Tailwind CSS and color schemes
- β Copies all component source code locally
- β Copies all JavaScript files locally
- β Full customization possible
- β No external runtime dependencies
- β Custom module prefixes
- Custom error translate function
config :salad_ui, :error_translator_function, {MyAppWeb.CoreComponents, :translate_error}Here is how to start develop SaladUI on local machine.
- Clone this repo
- Go into storybook folder
- Start storybook
cd storybook
mix phx.server
All v1 component are not covered by UnitTest. Currently I'm working on an important project so I don't have much time for this. If you're interested in this project, please help to add Unit Test if possible. π
| Component | v0 | v1 |
|---|---|---|
| Accordion | β | β |
| Alert | β | β |
| Alert Dialog | β | β |
| Avatar | β | β |
| Badge | β | β |
| Breadcrumb | β | β |
| Button | β | β |
| Card | β | β |
| Carousel | β | |
| Checkbox | β | β |
| Collapsible | β | β |
| Combobox | β | |
| Command | β | β @ilyabayel |
| Context Menu | β | |
| Dialog | β | β |
| Drawer | β | |
| Dropdown Menu | β | β |
| Form | β | β |
| Hover Card | β | β |
| Input | β | β |
| Input OTP | β | |
| Label | β | β |
| Pagination | β | β |
| Popover | β | β |
| Progress | β | β |
| Radio Group | β | β |
| Scroll Area | β | β |
| Select | β | β |
| Separator | β | β |
| Sheet | β | β |
| Skeleton | β | β |
| Slider | β | β |
| Switch | β | β |
| Table | β | β |
| Tabs | β | β |
| Textarea | β | β |
| Tooltip | β | β |
This project could not be available without these awesome works:
tailwind cssan awesome css utility projectturbopropI borrow code from here for merging tailwinds classesshadcn/uiwhich this project is inspired fromPhoenix Frameworkof course

