@svelte-parts/form-builder
TypeScript icon, indicating that this package has built-in type declarations

0.0.23 • Public • Published

@svelte-parts/form-builder

UI to create form descriptions for @svelte-parts/form.

Try it out in the svelte REPL

Install

npm install @svelte-parts/form-builder

Usage

<script>
  import FormBuilder from '@svelte-parts/form-builder'
</script>

<FormBuilder
  onChange={d => console.log('CHANGED', d)}
  onSubmit={d => console.log('SUBMITTED', d)}
  ignoreFields={['password', 'color']}
/>

Properties

  • onChange a function taking an array of Fields triggered on every change
  • onSubmit a function taking an array of Fields triggered when the user clicks on "Create form" (the button is only shown if this function is defined)
  • ignoreFields fields that should not be proposed to the user. Depending on the context, you may not want to encourage creating a password field, for example.

Package Sidebar

Install

npm i @svelte-parts/form-builder

Weekly Downloads

1

Version

0.0.23

License

MIT

Unpacked Size

18.9 kB

Total Files

21

Last publish

Collaborators

  • idris-maps