Installs Cinder UI into a Phoenix project.
By default the task references Cinder UI's CSS and JavaScript directly from
deps/cinder_ui — nothing is copied into your project. It performs the
following steps:
- 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. - Installs
tailwindcss-animateusing your detected or selected package manager. When nopackage.jsonexists inassets/, the installer will use the project rootpackage.jsonif present, or create a minimal one inassets/.
Because the referenced files live in deps/cinder_ui, they update
automatically whenever you upgrade the dependency — no re-run required.
Copy mode
With --copy, the task instead copies cinder_ui.css and cinder_ui.js into
your assets/ folder and patches app.css/app.js to reference the local
copies. Use this when you want to customize the shipped files, or when your
build can't resolve deps/cinder_ui (for example a monorepo with a relocated
node_modules).
In copy mode the files are a snapshot, so after upgrading Cinder UI re-run the
installer to refresh them. The patch step has already run, so pass
--skip-patching to only refresh the copies:
mix cinder_ui.install --copy --skip-patchingOptions
--copy- copycinder_ui.css/cinder_ui.jsintoassets/and reference the local copies instead ofdeps/cinder_ui--assets-path- path to the assets directory (default:assets)--package-manager-npm,pnpm,yarn, orbun--skip-existing- with--copy, do not overwrite copied files if they already exist--skip-patching- do not patchassets/css/app.cssorassets/js/app.js--dry-run- print planned changes without writing files or installing packages
Example
mix cinder_ui.install
mix cinder_ui.install --copy --package-manager pnpm