2.0.1 • Published 2 months ago

@sjsf/form v2.0.1

Weekly downloads
-
License
(MIT AND Apache-2...
Repository
github
Last release
2 months ago

@sjsf/form

Svelte 5 library for creating forms based on JSON schema. Unofficial port of react-jsonschema-form.

Installation

Install the library, basic theme and ajv for validation.

npm install @sjsf/form @sjsf/basic-theme @sjsf/ajv8-validator ajv@8

Usage

<script lang="ts">
  import { createForm, BasicForm, type Schema } from '@sjsf/form';
  import { resolver } from '@sjsf/form/resolvers/basic';
  import { translation } from '@sjsf/form/translations/en';
  import { theme } from '@sjsf/basic-theme';
  import { createFormValidator } from "@sjsf/ajv8-validator";

  const validator = createFormValidator();

  const schema: Schema = {
    title: 'Tasks',
    type: 'array',
    items: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          title: 'Name',
        },
        description: {
          type: 'string',
          title: 'Description',
        },
      },
      required: ["name"]
    },
  }

  const form = createForm({
    theme,
    schema,
    resolver
    validator,
    translation,
    onSubmit: console.log
  })
</script>

<BasicForm {form} />

License

This project includes modifications of code from react-jsonschema-form, which is licensed under the Apache License, Version 2.0. The rest of the project is under the MIT license.

See LICENSE-MIT and LICENSE-APACHE for details.

See also

2.0.0-next.15

2 months ago

2.0.0-next.8

4 months ago

2.0.0-next.9

4 months ago

2.0.0-next.6

4 months ago

2.0.0-next.7

4 months ago

2.0.0-next.4

5 months ago

2.0.0-next.5

5 months ago

1.8.0

7 months ago

2.0.0-next.10

3 months ago

1.6.1

9 months ago

2.0.0-next.11

3 months ago

1.6.0

9 months ago

2.0.0-next.12

3 months ago

2.0.0-next.13

3 months ago

1.4.0

9 months ago

2.0.0-next.14

3 months ago

2.0.0-next.2

5 months ago

2.0.0-next.3

5 months ago

2.0.0-next.0

5 months ago

2.0.0-next.1

5 months ago

2.0.1

2 months ago

2.0.0

2 months ago

1.9.2

6 months ago

1.9.1

7 months ago

1.9.0

7 months ago

1.7.0

8 months ago

1.5.1

9 months ago

1.5.0

9 months ago

1.3.0

9 months ago

1.2.0

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.2

10 months ago

1.0.0

10 months ago

0.2.7

10 months ago

0.2.6

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.0

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago