lion/packages/form
Jorge del Casar 98f1bb7e1c fix: normalize dependencies
Co-authored-by: jorenbroekema <Joren.Broekema@ing.com>
2021-01-06 10:53:38 +01:00
..
src feat: add types for fieldset and form 2020-09-28 14:41:31 +02:00
test fix: use lion/core types wherever possible 2020-11-09 14:04:05 +01:00
CHANGELOG.md Version Packages 2020-12-17 12:07:45 +00:00
index.js feat: release inital public lion version 2019-04-26 10:37:57 +02:00
lion-form.js feat: release inital public lion version 2019-04-26 10:37:57 +02:00
package.json fix: normalize dependencies 2021-01-06 10:53:38 +01:00
README.md fix: normalize dependencies 2021-01-06 10:53:38 +01:00

Form

lion-form is a webcomponent that enhances the functionality of the native form component. It is designed to interact with (instances of) the form controls.

import { html } from '@lion/core';
import '@lion/input/lion-input.js';
import './lion-form.js';

export default {
  title: 'Forms/Form/Overview',
};
export const main = () => html`
  <lion-form id="form">
    <form>
      <lion-input name="firstName" label="First Name" .modelValue=${'Foo'}></lion-input>
      <lion-input name="lastName" label="Last Name" .modelValue=${'Bar'}></lion-input>
    </form>
  </lion-form>
`;

Features

  • Data synchronization with models
  • Easy retrieval of form data based on field names
  • Advanced validation possibilities
  • Advanced user interaction scenarios via interaction states
  • Registration mechanism for form controls
  • Accessible out of the box

For more information about fields that are designed for lion-form, please read forms.

How to use

Installation

npm i --save @lion/form
import '@lion/form/lion-form.js';

Example

<lion-form>
  <form>
    <lion-fieldset name="fullName">
      <lion-input label="First Name" name="firstName"></lion-input>
    </lion-fieldset>
  </form>
</lion-form>