defmodule Surface.Components.Form.Label do @moduledoc """ Defines a label. Provides similar capabilities to Phoenix's built-in `label/2` function. Option `class` can be set directly and will override anything in `opts`. All given options are forwarded to the underlying tag. A default value is provided for for attribute but can be overridden if you pass a value to the for option. Text content would be inferred from field if not specified. """ use Surface.Component use Surface.Components.Events import Surface.Components.Utils, only: [events_to_opts: 1] import Surface.Components.Form.Utils @doc "The form identifier" prop form, :form, from_context: {Surface.Components.Form, :form} @doc "The field name" prop field, :any, from_context: {Surface.Components.Form.Field, :field} @doc "The CSS class for the underlying tag" prop class, :css_class @doc """ The text for the generated `