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
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.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
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
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
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
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
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
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










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