phcurado

phcurado

DaisyUIComponents is a library that seamlessly integrates the amazing DaisyUI component library into your Phoenix LiveView project.

It replaces Phoenix’s default CoreComponents with pre-styled DaisyUI components, making it easier to switch your application’s UI.
It also provides 30+ DaisyUI components built in using the Phoenix component engine.

Storybook: Phoenix + DaisyUI - Welcome

Links

https://github.com/phcurado/daisy_ui_components

Showing Posts 11 to 20

phcurado

phcurado OP

DaisyUI Components Version 0.8 Released :rocket:

This new version is now compatible with the new DaisyUI V5, thank you @typesend for starting this work on the repo.
The new UI can be seen on the storybook.

On top of that, new components were added, here is a quick display of them:

Label
The label component was introduced in the new DaisyUI version, we can add labels to inputs:

image

Code example:

<.label text="https://" type="input">
  <input type="text" placeholder="URL" />
</.label>

We can have labels before or after the input. We also have floating labels, take a look on the Label Storybook for all options

Fieldset
Probably the most important component of this release. The fieldset is useful to group several controls and is now used on all form inputs to group label, input and errors in a form.


Code example:

<.fieldset class="w-xs bg-base-200 border border-base-300 p-4 rounded-box">
  <.fieldset_legend>Login</.fieldset_legend>
  <.fieldset_label>Email</.fieldset_label>
  <.input type="email" placeholder="Email" />
  <.fieldset_label>Password</.fieldset_label>
  <.input type="password" placeholder="Password" />
  <.button class="btn btn-primary mt-4">Login</.button>
</.fieldset>

Fieldset Storybook

Progress
Maybe not the most popular component but it’s a nice one to have, it’s really easy to add it on your site:

Code example:

<.progress color="primary" max={100} value={40}/>

Progress Storybook

Footer
And the last component of this release, the footer component.


Footer Storybook

Roadmap

  • Compatibility with DaisyUI V5 - Done :white_check_mark:
  • Implement more components and storybooks, the missing components can be seen on the Readme component’s section
  • Support for tailwind 4.0
  • Monitor the new phoenix release to avoid compatibility issues when it’s released a new version
  • Create mix script to enable users to import the components of this library into their projects, sharing the same project namespace.

Thanks everyone :pray:

olivermt

olivermt

Is there any plans to add more reactivity on top of the existing daisy components? It is a glaring hole atm in Daisy that almost nothing is mobile first (try looking at the tables from a phone), but this seems very achievable to patch over in the library. Adding things like attrs for the col slots for how it collapses in lower media queries etc.

phcurado

phcurado OP

hey @olivermt,

There are plans to improve the components to have better ergonomics compared to the default daisyui styles. I’m implementing it little by little as I’m still focusing on having a bigger component coverage and storybook with all the examples.

For the table example, I believe the storybook is making the table a bit weird on mobile but you can check the same table on the default daisyUI docs: Tailwind Table Component – daisyUI which should look a bit better.

As for having collapsible columns, this should already be possible if using the table without the col slots. Using table with col slots - instead of using th td - is an option provided by this lib to have compatibility with the current phoenix generators. Since each element of the table can accept classes, you can choose to or hide/show a column based on a media query. For improving the table with slots, I can add a class attribute there so you can pass any class per column and I will also add on pipeline here to offer a collapsible option, great suggestion.

olivermt

olivermt

Splendid! And it is meant as critique of daisy itself, NOT of your package just to reiterate that.

I pay for tailwindui and everything there is staunchly mobile first, so it was a bit jarring to have to think reactively again when looking at Daisy again after the phoenix announcement to default to daisy :slight_smile:

Dmk

Dmk

Where/what was this announcement of defaulting to DaisyUI?

olivermt

olivermt

To be honest I don’t know. Everyone on elixir slack talked about it so confidently I didn’t bother doing a fact check :laughing:

LostKobrakai

LostKobrakai

Daily UI will become part of the next phoenix release, the change has been merged, but annoucements will likely only be had once the release is ready.

antfarm

antfarm

And here the announcement of Phoenix 1.8.0-rc:

bdarla

bdarla

First of all, that you for sharing this library!

A question I have relates with Phoenix 1.8 and the build-in support for DaisyUI.

For example, an avatar can be defined in plain HTML and DaisyUI classes as:

<div class="avatar">
    <div class="w-16 rounded-full">
      <img src="..." />
    </div>
</div>

while in DaisyUIComponents as

<.avatar online>
    <div class="w-16 rounded-full">
        <img src="..." />
    </div>
</.avatar>

Are they mere (equivalent) alternatives? Is there any benefit using the one against the other?

Edit: Can this library be used with Phoenix 1.8rc already?

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
rodloboz
I’ve started working on a new library to run SQL queries and do basic business intelligence. Think “Blazer for Elixir.” Currently it fe...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
CodeSync
:microphone: ElixirConf 2026 - Call for Talks is open! We’re heading to Chicago :united_states: :round_pushpin: In person + virtual :d...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews