# @arabdevelop/svelte-formly

Latest version **0.0.3** (published 2019-11-22) · 0 weekly downloads

## Install

```sh
npm install @arabdevelop/svelte-formly
pnpm add @arabdevelop/svelte-formly
yarn add @arabdevelop/svelte-formly
bun add @arabdevelop/svelte-formly
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-11-22 |
| First published | 2019-11-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 71.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 254 |
| Author | Kamal Sahmoud |
| Maintainers | marocdevelop |
| Keywords | svelte |

## Links

- npm: https://www.npmjs.com/package/@arabdevelop/svelte-formly
- Repository: https://github.com/arabdevelop/svelte-formly
- Homepage: https://github.com/arabdevelop/svelte-formly#readme
- Issues: https://github.com/arabdevelop/svelte-formly/issues
- npm.io page: https://npm.io/package/@arabdevelop/svelte-formly

## Dependencies (1)

- [clsx](https://npm.io/package/clsx.md) ^1.0.4

## Recent versions

- 0.0.3 (latest) — 2019-11-22
- 0.0.2 — 2019-11-22
- 0.0.1 — 2019-11-22
- 0.0.0 — 2019-11-22

## README

<p align="center">
  <img width="186" height="90" src="https://user-images.githubusercontent.com/218949/44782765-377e7c80-ab80-11e8-9dd8-fce0e37c235b.png" alt="Beyonk" />
</p>

# Svelte Formly

by [@kamalkech](https://github.com/kamalkech)

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) [![CircleCI](https://circleci.com/gh/beyonk-adventures/svelte-component-livereload-template.svg?style=shield)](https://circleci.com/gh/beyonk-adventures/svelte-component-livereload-template) [![svelte-v3](https://img.shields.io/badge/svelte-v3-blueviolet.svg)](https://svelte.dev)

## Features

- ⚡️ Generate Forms
- 😍 Easy to extend with custom field type, validation, wrapper and extension.

## Installation

npm i @arabdevelop/svelte-formly

## Usage

```javascript
<script>
  import { onDestroy } from "svelte";
  import { Field, valuesForm } from "@arabdevelop/svelte-formly/src";

  const fields = [
    {
      type: "text",
      name: "firstname",
      value: "",
      id: "firstname",
      placeholder: "Tap your first name",
      validation: ["required", "min:6"]
    },
    {
      type: "text",
      name: "lastname",
      value: "",
      id: "lastname",
      placeholder: "Tap your lastname"
    },
    {
      type: "email",
      name: "email",
      value: "",
      id: "email",
      placeholder: "Tap your email",
      validation: ["required", "email"]
    }
  ];

  let message = "";

  function onSubmit(evt) {
    var form = evt.target;
    valuesForm.subscribe(data => {
      if (data.isValidForm) {
        message = "Congratulation! now your form is valid";
      } else {
        message = "Your form is not valid!";
      }
    });
  }

  onDestroy(valuesForm);
</script>
```

```html
<h2>{message}</h2>
<form on:submit|preventDefault="{onSubmit}" novalidate>
  <Field {fields} />
  <button class="btn btn-primary" type="submit">Submit</button>
</form>
```

---
_Source: https://npm.io/package/@arabdevelop/svelte-formly · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
