freedive/lib/liliform/container.ex

23 lines
433 B
Elixir

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