freedive/lib/liliform/block.ex

23 lines
417 B
Elixir

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