Initial Commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
defmodule RiverConnectWeb.Components.UI.Label do
|
||||
@moduledoc false
|
||||
use RiverConnectWeb.Components.UI, :component
|
||||
|
||||
@doc """
|
||||
Renders a label.
|
||||
|
||||
## Examples
|
||||
|
||||
<.label>Send!</.label>
|
||||
"""
|
||||
attr :class, :string, default: nil
|
||||
attr :rest, :global, include: ~w(disabled form name value for)
|
||||
slot :inner_block, required: true
|
||||
|
||||
def label(assigns) do
|
||||
~H"""
|
||||
<label
|
||||
class={
|
||||
classes([
|
||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
||||
@class
|
||||
])
|
||||
}
|
||||
{@rest}
|
||||
>
|
||||
{render_slot(@inner_block)}
|
||||
</label>
|
||||
"""
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user