An attemp to bring shadcn ui components to Phoenix Liveview.
- Using
salad_ui
as part of your project:
- Adding
salad_ui
to your list of dependencies inmix.exs
:
def deps do
[
{:salad_ui, "~> 0.12.0", only: [:dev]},
{:tails, "~> 0.1"}
]
end
- Init Salad UI in your project
#> cd your_project
#> mix salad.init
# install some components
#> mix salad.add label button
- Using
salad_ui
as a library:
- Adding
salad_ui
to your list of dependencies inmix.exs
:
def deps do
[
{:salad_ui, "~> 0.12.0", only: [:dev]}
]
end
- Init Salad UI in your project with option
--as-lib
#> cd your_project
#> mix salad.init --as-lib
- 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
- Clone
https://github.com/bluzky/salad_storybook
in the same directory withSaladUI
- Start storybook
cd 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.
- ✅ Accordion
- ✅ Alert
- 🚧 Alert Dialog
- ✅ Avatar
- ✅ Badge
- ✅ Breadcrumb
- ✅ Button
- ✅ Card
- Carousel
- ✅ Chart
- ✅ Checkbox
- 🚧 Collapsible
- Combobox
- Command
- 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
- ✅ Toggle
- ✅ Toggle Group
This project could not be available without these awesome works:
tailwind css
an awesome css utility projecttails
for merging tailwind classshadcn/ui
which this project is inspired fromPhoenix Framework
of course