I am learning Elixir and Phoenix since 6 month. I am looking to build livecomponent to use in HEEX and embed the tailwin style and live action. I need to feed this livecomponent with static data.
2 samples to explain the idea :
- create a MyApp MenuComponent, I want to use it in HEEX with
`
<.live_component module={MyAppWeb.MenuComponent} id=“menu_component”>
<:MenuItem, caption: "SELL", link: "sellLink">
<:MenuItem, caption: "RENT", link: "rentLink">
</.live_component>
`
- create a MyApp RadioGroup to use inside the HEEX with static items :
`
<.live_component module={MyAppWeb.RadioGroupComponent} id=“radiogroup_component”>
<:RadioItem, caption: "SELL", value: "sell">
<:RadioItem, caption: "RENT", value: "rent">
</.live_component>
`
slot does’nt work to do that for instance, in the menu, the data are used twice, in the dektop and in the mobile menu. I checked variable as @inputs but I loose controle at compile time and I have static description, so I do not need variable in assigns.
What would be the way you suggest to do that ?