Current section
Files
Jump to
Current section
Files
lib/components/containers.ex
defmodule SigmaKit.Components.Containers do
use Phoenix.LiveComponent
attr :shadow, :boolean, default: true
attr :title, :string, default: nil
slot :action_bar
slot :inner_block
def box(assigns) do
~H"""
<div class={[
"border-zinc-100 border rounded-lg p-4",
@shadow && "shadow-lg"
]}>
<div :if={!Enum.empty?(@action_bar) || @title} class="flex 4 justify-between my-2 h-8">
<div class="font-medium text-lg">
{@title}
</div>
<div class="flex gap-4 justify-end">
{render_slot(@action_bar)}
</div>
</div>
{render_slot(@inner_block)}
</div>
"""
end
end