README.md
June 17, 2025 ยท View on GitHub
A collection of Live View components inspired by shadcn

๐ง V1 is now beta release
Demo storybook v1
Installation
- Add
salad_uito yourmix.exs
def deps do
[
{:salad_ui, "~> 1.0.0-beta.3"},
]
end
- Choose your installation method:
Method 1: Quick Setup (Using as Library)
For a quick start with minimal configuration:
mix salad.setup
This 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
end
Method 2: Local Installation (Customizable)
For full customization with local component files:
# Default installation
mix salad.install
# With custom prefix and color scheme
mix salad.install --prefix MyUI --color-scheme slate
This 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
What Each Method Does
mix salad.setup
- โ Sets up Tailwind CSS and color schemes
- โ Configures JavaScript hooks and components
- โ Ready to use immediately
- โ Components cannot be customized
- โ Uses external package dependencies
mix salad.install
- โ 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
More configuration
- Custom error translate function
config :salad_ui, :error_translator_function, {MyAppWeb.CoreComponents, :translate_error}
๐ ๏ธ Development
Here is how to start develop SaladUI on local machine.
- Clone this repo
- Go into storybook folder
- Start storybook
cd storybook
mix phx.server
Unit Testing
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. ๐
List of components
| 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 | โ | โ |
๐ Contributors
๐ Credits
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
