label

Information

Folder
src/components/elements/form-element/label

Files

Schema
// src/components/elements/form-element/label/schema.yaml

$schema: http://json-schema.org/draft-07/schema#
$id: /elements/form-element/label
additionalProperties: false
required:
  - title
properties:
  attributes:
    type: string
  classes:
    type: array
    items:
      type: string
  for:
    type: string
  required:
    type: boolean
  title:
    type: string
Mocks
// src/components/elements/form-element/label/mocks.yaml

title: Input label
for: foo
$variants:
  - $name: Required
    required: true
Template
// src/components/elements/form-element/label/label.twig

<label{{ attributes }} for="{{ for }}" class="FormElementLabel {{ classes|join(" ") }}{% if required %} is-required{% endif %}">{{ title }}</label>

Variants

default
Open
Required
Open