OlisUI for LiveView
OlisUI is an early-stage component library for Phoenix LiveView, built with Tailwind CSS v4 and Alpine.js. It includes form controls, navigation, overlays, feedback, tables, and more. APIs are still evolving.
Try the preview
mix deps.get
npm ci
mix preview
Open localhost:4000 for the component gallery or localhost:4000/live-preview for LiveView examples. For a complete application, see the admin dashboard example.
Install
Add OlisUI to your Phoenix app's mix.exs.
{:olis_ui, "~> 0.1.0"}
Then run:
mix deps.get
mix olis_ui.install
cd assets
npm install --save-exact alpinejs@3.17.5 @alpinejs/collapse@3.17.5 tw-animate-css@1.4.0
In assets/css/app.css, replace the Tailwind import with:
@import "./olis_ui.css";
In assets/js/app.js, start OlisUI before connecting your LiveSocket and add its DOM callback to the LiveSocket options:
import { olisUI } from "./olis_ui";
olisUI.start();
// In your existing LiveSocket options:
dom: { onBeforeElUpdated: olisUI.beforeUpdate }
Restart your asset watcher. If your app already starts Alpine, follow the manual Alpine setup instead.
Use components
Call components directly to keep your existing Phoenix imports:
<OlisUI.Button.button phx-click="save">Save changes</OlisUI.Button.button>
<OlisUI.Forms.text_field field={@form[:email]} label="Email" type="email" />
To use the shorter <.button> syntax, import the component modules you need in your LiveView or HTML helpers:
import OlisUI.Button
import OlisUI.Forms
Resolve any name conflicts with CoreComponents. See the component reference for module names, examples, and interactive behavior.
The default theme is light. Set data-theme="dark" on the document root for the dark palette.
Development
After installing dependencies, run the checks with:
mix format --check-formatted
mix credo
mix test
npm run format:check
npm run lint
npm run lint:css
npm run test:js
License
OlisUI is licensed under Apache-2.0. See the third-party notices for bundled assets.