Installs Cinder UI into a Phoenix project.
Cinder UI's CSS and JavaScript are referenced directly from deps/cinder_ui —
nothing is copied into your project, and there is no npm package to install
(the tailwindcss-animate utilities are inlined into Cinder UI's CSS). The
task performs two edits:
- Updates
assets/css/app.csswith:@source "../../deps/cinder_ui";@import "../../deps/cinder_ui/priv/templates/cinder_ui.css";
- Updates
assets/js/app.jsto importCinderUIHooksfrom thecinder_uipackage (resolved via Phoenix's default esbuildNODE_PATH) and merges them into your LiveView hooks.
Because the referenced files live in deps/cinder_ui, they update
automatically whenever you upgrade the dependency — no re-run required.
Doing it by hand
The CSS edit is just two lines. If you would rather not run the task, add them
to assets/css/app.css yourself (after @import "tailwindcss";):
@source "../../deps/cinder_ui";
@import "../../deps/cinder_ui/priv/templates/cinder_ui.css";Then import the hooks in assets/js/app.js and merge them into your LiveView
hooks:
import { CinderUIHooks } from "cinder_ui"
// ...
let liveSocket = new LiveSocket("/live", Socket, {
hooks: { ...CinderUIHooks },
// ...
})Options
--assets-path- path to the assets directory (default:assets)--skip-patching- do not patchassets/css/app.cssorassets/js/app.js--dry-run- print planned changes without writing files
Example
mix cinder_ui.install
mix cinder_ui.install --assets-path assets