PyraUI – Phoenix LiveView UI Library

A modular, reusable UI library for Phoenix LiveView applications, enabling developers to rapidly build interactive, responsive, and consistent interfaces.

Features

Installation

Add to your mix.exs:

def deps do
[
{:pyraui, path: "../pyraui"} # or {:pyraui, git: "..."}
]
end

Then import in your PyrauiWeb module or use use PyrauiWeb, :html in your templates.

Components

Base Elements

Layout Components

Feedback Components

Usage Examples

Button

<.button>Click me</.button>
<.button variant="primary" size="lg">Large Button</.button>
<.button disabled={true}>Disabled</.button>
<.button loading={true}>Loading...</.button>

Input

<.input type="text" label="Name" field={@form[:name]} />
<.input type="email" label="Email" field={@form[:email]} error="Invalid email" />

Alert

<.alert variant="success">Operation successful!</.alert>
<.alert variant="error">Something went wrong</.alert>
<.alert variant="info" dismissible={true}>Information message</.alert>

Card

<.card>
<h2>Card Title</h2>
<p>Card content</p>
</.card>

Development

This project also serves as a playground/demo application:

  1. Clone the repository
  2. Install dependencies: mix deps.get
  3. Start the server: mix phx.server
  4. Visit http://localhost:4000 to see the component playground

Roadmap

License

MIT