Fl4m3Ph03n1x
Background
I have a small Phoenix 1.7 app where I am trying to add a radial progress bar, using the default TailwindUI components: Tailwind CSS Components - Tailwind Plus
Unfortunately for me, I was only able to find normal progress bars:
Namely:
<div class="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 45%"></div>
</div>
The only radial progress bar I found was one using DaisyUI:
However, I want to avoid installing anything extra, I really just want to use the default tailwindUI and tailwindCSS that come with Phoenix 1.7
Questions
- Does someone know how to create a a radial progress bar component using the default setup that comes with Phoenix LiveView 1.7?
- Am I missing some component that already does this?
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
outlog
you can do it like this: https://www.tailwindcsscomponent.com/circular-progress-bar
Fl4m3Ph03n1x
I did try something similar before, unfortunately, I get the following error in my
heexfile:code:
error
LostKobrakai
Use of invalid html attributes is not allowed in heex. You can use the longer
x-bind:…format.Fl4m3Ph03n1x
That’s fair, but thus far I was not able to find an example that does not use such attributes.
What is it and what does it do? I was not able to find anything in the docs about it:
LostKobrakai
I mean sure if you’re looking at the LV docs and not the Alpine docs.
:attris a short form forx-bind:attrin alpine.Fl4m3Ph03n1x
I am unsure on how the Tailwind package and Apline.js are connected:
https://github.com/phoenixframework/tailwind
Clearly i am looking in the wrong place. Do Phoenix 1.7 applications now also use AlpineJS by default?
LostKobrakai
No. Not sure where you got that html you posted, but it’s using alpine.
outlog
apologies for posting a link that depends on alpine.. I believe it’s best avoided nowadays with all the liveviewjs improvements..
think you need to go with this underlying example Building a Progress Ring, Quickly | CSS-Tricks - and then maybe take some tailwind styling from the alpine dependent one..
Fl4m3Ph03n1x
No need to apologize !
Even though the link and code you shared used alpine, it was still very educative. I was able to analyze the code and create a component that does exactly what I want. Its also quite pretty, so I am very proud. This code uses only Phoniex LV vanilla, no extra CSS no extra anything !
core_components:Usage in
my_app_live.heex.html:Will produce the following:
Possible improvements
Currently i am not sure if there is a more elixir way of updating the
assigns:But other than that, I am pretty happy with it.
Additional info
For those of you curious, you can also check this other solution someone else provided in SO:
I hope this helps!
dfalling
You can compute this circumference outside of the function since it’s never changing.
Eg
(not sure how important precision is for that variable)