🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sjsf/form

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sjsf/form - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
+7
LICENSE
Copyright (c) 2024 Roman Krasilnikov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @sjsf/form
Svelte 5 library for creating forms based on JSON schema.
Unofficial port of [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form).
- [Documentation](https://x0k.github.io/svelte-jsonschema-form/)
- [Playground](https://x0k.github.io/svelte-jsonschema-form/playground/)
## Installation
Install the library and `ajv` for validation.
```shell
npm install @sjsf/form @sjsf/ajv8-validator ajv@8
```
## Usage
```svelte
<script lang="ts">
import Ajv from 'ajv';
import { Form } from '@sjsf/form';
import { translation } from '@sjsf/form/translations/en';
import { theme } from '@sjsf/form/basic-theme';
import {
AjvValidator,
addFormComponents,
DEFAULT_AJV_CONFIG,
} from "@sjsf/ajv8-validator";
const validator = new AjvValidator(
addFormComponents(new Ajv(DEFAULT_AJV_CONFIG))
);
</script>
<Form
{...theme}
schema={{
title: 'Tasks',
type: 'array',
items: {
type: 'object',
properties: {
name: {
type: 'string',
title: 'Name',
},
description: {
type: 'string',
title: 'Description',
},
},
required: ["name"]
},
}}
{validator}
{translation}
onSubmit={console.log}
/>
```
## License
This project includes modifications of code from [react-jsonschema-form](https://github.com/rjsf-team/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](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.
## See also
- [Other JSON Schema to Web UI tools](https://json-schema.org/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=schema-to-web-UI)
- [Converting JSON to table](https://github.com/x0k/json-to-table)
- Simple build automation tool [mk](https://github.com/x0k/mk)
+2
-3
{
"name": "@sjsf/form",
"version": "0.0.1",
"version": "0.0.2",
"description": "Svelte 5 library for creating forms based on JSON schema.",

@@ -16,4 +16,3 @@ "license": "(MIT AND Apache-2.0)",

"publishConfig": {
"provenance": true,
"access": "public"
"provenance": true
},

@@ -20,0 +19,0 @@ "repository": {