JSPM

@rmwc/formfield

14.3.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12116
  • Score
    100M100P100Q135012F
  • License MIT

Package Exports

  • @rmwc/formfield
  • @rmwc/formfield/styles

Readme

Form Fields

MDC Form Field provides an mdc-formfield helper class for easily making theme-aware, RTL-aware form field + label combos. It also provides an MDCFormField class for easily making input ripples respond to label events.

<FormField>
  <input type="checkbox" id="input" />
  <label htmlFor="input">Input Label</label>
</FormField>

Align end

<FormField alignEnd>
  <input type="checkbox" id="input" />
  <label htmlFor="input">Input Label</label>
</FormField>

No wrap

<FormField noWrap>
  <input type="checkbox" id="input" />
  <label htmlFor="input">Input Label</label>
</FormField>

Space between

<FormField spaceBetween>
  <input type="checkbox" id="input" />
  <label htmlFor="input">Input Label</label>
</FormField>

FormField

A FormField component.

Props

Name Type Description
alignEnd boolean Position the input after the label.
foundationRef Ref<MDCFormFieldFoundation<>> Advanced: A reference to the MDCFoundation.
noWrap boolean Forces text to stay on a single line.
spaceBetween boolean Adds space between content.