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