- Notifications
You must be signed in to change notification settings - Fork6
Svelte 5 library for creating forms based on JSON schema.
License
NotificationsYou must be signed in to change notification settings
x0k/svelte-jsonschema-form
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Svelte 5 library for creating forms based on JSON schema.Unofficial port ofreact-jsonschema-form.
Install the library, basic theme andajv for validation.
npm i @sjsf/form @sjsf/basic-theme @sjsf/ajv8-validator ajv@8
<scriptlang="ts">import {createForm,BasicForm,typeSchema }from'@sjsf/form';import {resolver }from'@sjsf/form/resolvers/basic';import {translation }from'@sjsf/form/translations/en';import {createFormMerger }from'@sjsf/form/mergers/modern';import {createFormIdBuilder }from'@sjsf/form/id-builders/modern';import {createFormValidator }from'@sjsf/ajv8-validator';import {theme }from'@sjsf/basic-theme';import'@sjsf/basic-theme/css/basic.css';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,translation, merger:createFormMerger, validator:createFormValidator, idBuilder:createFormIdBuilder, onSubmit:console.log })</script><BasicForm {form} />
This project includes modifications of code fromreact-jsonschema-form, which is licensed under the Apache License, Version 2.0.The rest of the project is under the MIT license.
SeeLICENSE-MIT andLICENSE-APACHE for details.
About
Svelte 5 library for creating forms based on JSON schema.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.