freedive/lib/liliform/box.ex

23 lines
409 B
Elixir

defmodule Liliform.Box do
use Liliform.Component
@doc """
Renders a box.
"""
attr :class, :string, default: "", doc: "additional classes"
attr :rest, :global
slot :inner_block, required: true
def box(assigns) do
assigns =
assigns
|> set_bulma_classes()
~H"""
<div class={["box", @class]} {@rest}>
<%= render_slot(@inner_block) %>
</div>
"""
end
end