Chus
Hello.
I’m trying to use https://shoelace.style with Phoenix, the idea is use web components in client and hooks to interact with Phoenix.
I can see the component but the styles its impossible.
How is the way to use js and css from a component library in order to use easily in Phoenix 1.7?
Thanks
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
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
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
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
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 everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #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
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
The default assets management is split between js and css. Js is handled by esbuild, css is handled by tailwindcss cli. You can either make tailwind import shoelace css or handle shoelace css with esbuild, by linking the css file it’ll built in your root layout
root.html.heex.derek-zhou
Phoenix is frontend pipeline agnostic. I’ve use it with webpack, snowpack, esbuild, Vite or no build step at all. Everything is possible; however, there may not be a step by step tutorial that match your needs exactly. IMHO, most tutorials off the internet are not very valuable; you are better off figuring it out on your own.
Kurisu
One of the aspects I appreciate about these tools, particularly the Tailwind CSS CLI, is their versatility. They can be utilized even when Tailwind CSS isn’t the primary styling method for the templates.
In projects where other CSS frameworks like Bulma are used instead of Tailwind CSS, I believe it’s not necessary to remove the Tailwind configuration. It worked fine for me at least.
However, it’s worth noting that the Tailwind CSS CLI lacks some features like SASS assets management. Fortunately, we have an alternative solution in Dart Sass.
The great news is that we can use both the Tailwind CSS CLI and Dart Sass together. The approach would be to first build an output file with Dart Sass (perhaps named
app.css.tailwind), which would then be processed by the Tailwind CSS CLI. It worked fine for me at least.For a detailed explanation on this process and other aspects of assets management, I recommend checking out this tutorial: Using Tailwind CSS in Phoenix.
oleksify
We use Shoelace with Phoenix. It’s working great, but you have to understand how web components works. Styling web components is different because they use Shadow DOM. Shoelace have a section in docs explaining that, but it’s general to all web components.
yasoob
Hi @oleksify are you using shoelace with LiveView or dead views? I am asking because I was under the impression that it is not possible to use shoelace easily with LiveView due to this issue. I would love to know if the situation has changed
oleksify
We do use it with LV. We did not hit this issue yet, also we’re not using Button component and we’re careful with attributes in general.
Everything has been working great so far. though it’s not that easy with LV. We build layer on top of Shoelace and our own web components. So, we have LV component wrapping Web Component and passing down the props, event handlers, etc. Then, we also add hooks for each components where we get passed down even names and add JS handlers for them or wire to Shoelace events. Or add event listeners for Shoelace events.
We did try GitHub - launchscout/live_elements: A library to make custom elements and LiveView so happy together · GitHub but decided to go on our own, to have more control over everything.
So far, web components (native custom elements) is the best thing (IMO) you can use for complex client-side UI in Phoenix.Mainly, because you slot html from phoenix inside and everything will just work. This is not possible with React and co, where you cant wrap some html from server with component - you have to pass everything through props, etc.
Chus
Do you recommend web components with Shadow DOM over a CSS library like daisyui?
Thanks
oleksify
Short answer - Yes, absolutely.
Long answer - it all depends on the complexity of your app. Sometimes simple things like DaisyUI is enough. But when you need good a11y with more complex components - like dropdowns, combo boxes, keyboard navigation, tooltips that know how to behave depending on surrounding space - you will hit CSS solutions limitations. If that’s your case - I would suggest using web components.
oleksify
Just keep in web components specifics - Shadow DOM behave in a specific way. You have styles scoping and isolation which is really cool. But then, you can hit problems with forms, for example. If you have shadow DOM input within light DOM form - it will be invisible to your form. Shoelace fixes this so it’s safe to use their components - but when you start grabbing components from github - keep that in mind.
Chus
Thanks for your answers