GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - plausible/prima: Headless UI component library for Phoenix Liveview

BranchesTags
Open more actions menu

Latest commit

 

History

395 Commits
395 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
assets
assets
 
 
config
config
 
 
demo
demo
 
 
lib
lib
 
 
test
test
 
 
.dockerignore
.dockerignore
 
 
.formatter.exs
.formatter.exs
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.tool-versions
.tool-versions
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 
mix.lock
mix.lock
 
 
package.json
package.json
 
 

Repository files navigation

Prima

Hex.pm

prima (adj., Latin)

First; primary. – Used in alchemical texts denoting the original, undifferentiated substance from which all things are formed and upon which the alchemical work is based.

Prima is a Phoenix LiveView component library providing unstyled, accessible UI components. It's designed as a reusable library that developers can integrate into Phoenix applications and style according to their needs.

Installation

Add prima to your list of dependencies in mix.exs:

def deps do
  [
    {:prima, "~> 0.3.0"}
  ]
end

Include Prima's JavaScript hooks in your application:

// assets/js/app.js
import { PrimaHooks } from "prima"

let liveSocket = new LiveSocket("/live", Socket, {
  hooks: { ...PrimaHooks },
  // ... other options
})

Use components in your templates:

<Prima.Dropdown.dropdown id="demo-dropdown">
  <Prima.Dropdown.dropdown_trigger>
    Open Dropdown
  </Prima.Dropdown.dropdown_trigger>

  <Prima.Dropdown.dropdown_menu>
    <Prima.Dropdown.dropdown_item>Item 1</.dropdown_item>
    <Prima.Dropdown.dropdown_item>Item 2</.dropdown_item>
  </Prima.Dropdown.dropdown_menu>
</Prima.Dropdown.dropdown>

Development

This repository is structured with the library at the root and a demo application in the demo/ directory.

Library Development

Install the versions pinned in .tool-versions with mise install or asdf install. For asdf, add the plugins before installing the versions:

asdf plugin add erlang
asdf plugin add elixir
asdf plugin add nodejs
asdf plugin add chromedriver https://github.com/mise-plugins/mise-chromedriver.git
asdf install

Browser tests also need Google Chrome; the pinned ChromeDriver is selected automatically by mise or asdf. Keep Chrome and ChromeDriver on the same major, minor, and build version when updating either one.

# From root directory
mise install            # Or: asdf install
mix setup               # Install dependencies and build the library assets
mix hex.build          # Build hex package

Running the Demo Application

# From demo/ directory
cd demo
mix setup              # Install demo dependencies and build demo assets
mix phx.server         # Start development server

Visit http://localhost:4000 to see all components in action. The demo application automatically reloads when you make changes to library code.

Testing

# Full demo test suite (from root; delegates to demo/)
mix test

# Equivalent command from demo/
cd demo
mix test               # Run ExUnit and Wallaby tests

The test suite includes both unit tests and comprehensive browser-based integration tests using Wallaby to ensure all interactive behaviors work correctly.

About

Headless UI component library for Phoenix Liveview

prima-lingering-feather-539.fly.dev/

Topics

elixirliveviewphoenixphoenix-liveview

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

14 stars

Watchers

0 watching

Forks

5 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.