brainlid

brainlid

Passing Unknown Attributes into Your Component

On your LiveView page, you are using a custom component. You want to be able to pass HTML attributes into the component, but the component doesn’t know anything about the attributes being passed! You need a way to pass arbitrary attributes through and get them where you want them.

I use lots of stateless LiveView components in my projects. A tip I learned makes it easier to keep components generic and reusable. Now written up as a recipe!

Where Next?

Popular Frontend topics Top

AstonJ
Haven’t watched it yet but posting it and bookmarking the thread :nerd_face: TypeScript continues to soar in popularity…
New
First poster: bot
A beginner’s guide to developing with React. React is a JavaScript user interface (UI) library that was built and is maintained by Faceb...
New
psantos
In this tutorial, I’ll walk you step-by-step on how to install TailwindCSS 2.0 on Ruby on Rails.
New
First poster: bot
Decided to write this blog post because I couldn’t find any documentation or online examples like the one I’m sharing here. Every example...
New
First poster: bot
When web accessibility comes to mind most people think of just adding an alt text to an image, but there is much more to it! This article...
New
First poster: bot
Add WebAssembly, get performance. Is that how it really works? The incredibly unsatisfying answer is: It depends. It depends on oh-so-ma...
New
First poster: AstonJ
In this article, I will share with you some very useful HTML tips . Enjoy! ** Post will be updated regularly with new tips!* The loa...
New
First poster: AstonJ
;; This is an animated & interactive guide to ;; building a game in ClojureScript, because ;; I find the design patterns very intere...
New
First poster: bot
Let’s build a fully functioning and settable “analog” clock with CSS custom properties and the calc() function. Then we’ll convert it int...
New
AstonJ
I love videos like this and it follows the same theme as @jaeyson’s thread here - I reckon the @ElixirCasts crew should consider experime...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New