Welcome to PureAdmin for Phoenix
keen_pure_admin is a Phoenix LiveView component library that wraps the
Pure Admin CSS framework (@keenmate/pure-admin-core) into function components
and LiveComponents.
Drop-in replacement for Phoenix CoreComponents — provides button/1,
modal/1, table/1, input/1, and 35+ more components
with full BEM class support.
Components
Ready to use
JS Hooks
LiveView integrated
Themes
Fully customizable
About This Demo
This documentation site showcases the keen_pure_admin component library with multiple theme options. Use the settings panel (gear icon) to switch between themes and customize the appearance.
On initial page load, you may notice a brief flash of the default theme before your selected theme loads. This is expected behavior in this demo.
Why? The default theme is bundled statically to prevent unstyled content (FOUC), then your saved theme preference loads dynamically via JavaScript.
In a production application, you would import only one theme statically in your CSS. This eliminates the flash entirely since there's no theme switching overhead.
About SettingsPanel
The SettingsPanel component (gear icon in the corner) is primarily a demo and development tool
to showcase what's possible with pure-admin-core. It's not typically something you'd expose to end users in production.
In a real application, these settings would be handled differently:
- App-level constants (hardcoded): theme, layout width, sidebar behavior — decided during development
- User preferences (stored per-user): font size, compact mode — saved to user profile/database
- Design decisions (not configurable): avatar visibility, icon-only tabs — part of your app's design
The SettingsPanel demonstrates runtime customization, but most apps would make these choices at build time or store them server-side.
Installation
Prerequisites: create a Phoenix project without Tailwind:
mix phx.new my_app --no-tailwind
Add keen_pure_admin to your mix.exs:
From Hex (recommended)
{:keen_pure_admin, "~> 1.0.0-rc.2"}
From GitHub
{:keen_pure_admin, github: "KeenMate/keen-pure-admin", tag: "v1.0.0-rc.2"}
Basic Setup
After installation, replace Phoenix's CoreComponents with PureAdmin and set up the layout.
-
Replace CoreComponents import
In your
MyAppWebmodule, replaceimport MyAppWeb.CoreComponentswith:elixiruse PureAdmin.Components -
Install a theme
Download a theme from pureadmin.io or use the Pure Admin CLI:
bashnpx @keenmate/pureadmin install audi -
Set up the layouthtml
<.navbar> <:start> <.navbar_burger /> <.navbar_brand>My App</.navbar_brand> </:start> </.navbar> <.layout> <.layout_inner> <.sidebar> <.sidebar_item label="Dashboard" icon="fa-solid fa-gauge" href="/" /> </.sidebar> <.layout_content> <.main> <%= @inner_content %> </.main> </.layout_content> </.layout_inner> </.layout> -
Register JS hooks
In your
app.js:javascriptimport { PureAdminHooks } from "keen_pure_admin" let liveSocket = new LiveSocket("/live", Socket, { hooks: { ...PureAdminHooks } }) -
Use components anywherehtml
<.card title_text="My Card"> <.alert variant="info">Welcome to Pure Admin!</.alert> <.button variant="primary">Submit</.button> </.card>
Responsive Font Sizing
Pure Admin uses a 10px rem base — the html font-size is 10px, so all rem values
scale proportionally. Changing the html font-size scales the entire UI: text, spacing, components.
Shorthand (recommended)
One class for the common case — default on desktop, larger on mobile:
<html class="pa-font-responsive">
<!-- Desktop: 10px base (16px body text) -->
<!-- Mobile (<=768px): 12px base (~19px body text) -->
Granular Control
Pick exact sizes for desktop and mobile independently:
<html class="pa-font-base-10 pa-font-mobile-12">
| Class | html font-size | Body text result |
|---|---|---|
pa-font-base-9 / pa-font-mobile-9 |
9px | ~14px |
pa-font-base-10 / pa-font-mobile-10 |
10px | 16px (default) |
pa-font-base-11 / pa-font-mobile-11 |
11px | ~18px |
pa-font-base-12 / pa-font-mobile-12 |
12px | ~19px |
@media (max-width: 640px) {
html { font-size: 12px; }
}
Available Themes
Pure Admin comes with 5 example themes that serve as starter packs for your own customization. Each theme demonstrates different color schemes and provides a foundation you can build upon.
Audi
Clean design with sharp contrasts. A good starting point for modern admin interfaces.
Corporate
Traditional look with conservative colors. Starter for business-oriented applications.
Dark
Dark mode example. Use as a base for building your own dark theme variant.
Express
Bolder accent colors. Example of a more vibrant color palette.
Minimal
Subtle colors with reduced visual noise. Starting point for minimalist designs.
Component Overview
The library includes 35+ components organized into logical categories:
Layout
- Layout, LayoutInner, LayoutContent
- Navbar, NavItem, NavDropdown
- Sidebar, SidebarItem
- Main, Footer
Forms
- Input, Select, Textarea
- Checkbox, Radio
- SimpleForm, FormGroup
- CheckboxList
Feedback
- Alert, Callout
- Toast, Flash
- Modal, DialogService
- Loader
Data Display
- Table, TableResponsive
- Card, Stat
- Badge, BadgeGroup
- Code, CodeBlock
Navigation
- Tabs
- CommandPalette
- Pager
- SettingsPanel
Interactive
- Button, ButtonGroup
- Tooltip, Popover
- Popconfirm
- Timeline
Explore the sidebar navigation to see detailed examples and documentation for each component.
Next Steps
Browse the Components Overview to see all available components with live examples.
See the CoreComponents Migration guide for a full mapping from Phoenix defaults.