form-element-label

Information

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

Files

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

$schema: http://json-schema.org/draft-07/schema#
$id: /fsk/form/form-element/form-element-label
additionalProperties: false
properties:
  attributes:
    type: object
  required:
    type: boolean
  title:
    type: string
  title_display:
    type: string
    enum:
      - invisible
required:
  - attributes
  - title
Mocks
// src/components/fsk/form/form-element/form-element-label/mocks.yaml

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

<label{{ attributes ? attributes|without("class", "for") : "" }} for="{{ attributes.for }}" class="FskFormElementLabel{{ title_display == 'invisible' ? " u-hiddenVisually" : "" }} {{ attributes.class }}{% if required %} is-required{% endif %}">{{ title }}</label>

Variants

default
Open
Required
Open