field function

HTMLElement field(
  1. String label,
  2. HTMLElement input, {
  3. String? hint,
})

A labelled form field wrapping input, with an optional hint.

Implementation

web.HTMLElement field(String label, web.HTMLElement input, {String? hint}) =>
    el(
      'div',
      classes: 'field',
      children: [
        el('label', text: label, attrs: {'for': input.id}),
        input,
        if (hint != null) el('div', classes: 'hint', text: hint),
      ],
    );