I have the following component and want to add bg-blue-100
as the class
depending of the value of @is_active
. I can’t find an example in Phoenix.Component — Phoenix LiveView v0.20.3 of how to do that. How can I?
attr :is_active, :boolean, default: false, doc: "active state of the item"
slot :inner_block
def top_navigation_entry(assigns) do
~H"""
<button
type="button"
class="bg-blue-100 relative text-xs text-brand-silver-900 font-medium flex flex-col items-center justify-center gap-1.5 py-3"
>
<%= render_slot(@inner_block) %>
</button>
"""
end