Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
@rjsf/core
Advanced tools
A simple React component capable of building HTML forms out of a JSON schema.
@rjsf/core is a React library for building forms from JSON schema. It provides a simple way to create and manage forms in React applications by leveraging JSON schema definitions.
Form Creation
This feature allows you to create a form based on a JSON schema. The schema defines the structure and validation rules for the form fields.
const Form = require('@rjsf/core').default;
const schema = {
title: "A registration form",
type: "object",
required: ["firstName", "lastName"],
properties: {
firstName: {type: "string", title: "First name", default: "Chuck"},
lastName: {type: "string", title: "Last name"},
age: {type: "integer", title: "Age"}
}
};
const App = () => (
<Form schema={schema} />
);
Custom Widgets
This feature allows you to use custom widgets for form fields. You can define your own React components to be used as widgets in the form.
const { default: Form } = require('@rjsf/core');
const CustomWidget = (props) => {
return (
<input type="text" value={props.value} onChange={(event) => props.onChange(event.target.value)} />
);
};
const schema = {
title: "A form with custom widget",
type: "object",
properties: {
customField: {type: "string", title: "Custom Field"}
}
};
const uiSchema = {
customField: {
"ui:widget": CustomWidget
}
};
const App = () => (
<Form schema={schema} uiSchema={uiSchema} />
);
Form Validation
This feature allows you to define validation rules in the JSON schema. The form will automatically validate the input based on these rules.
const { default: Form } = require('@rjsf/core');
const schema = {
title: "A form with validation",
type: "object",
properties: {
age: {type: "integer", title: "Age", minimum: 18}
}
};
const App = () => (
<Form schema={schema} />
);
Formik is a popular form library for React that provides a higher-level API for managing form state, validation, and submission. Unlike @rjsf/core, Formik does not use JSON schema for form definitions but offers more flexibility in handling complex form logic.
React Hook Form is a performant, flexible, and extensible form library for React. It uses hooks to manage form state and validation, providing a more lightweight and performant alternative to @rjsf/core. It does not rely on JSON schema but offers great control over form behavior.
Redux Form is a library for managing form state in Redux. It integrates deeply with Redux to provide a seamless way to handle form state and validation. Unlike @rjsf/core, it requires Redux as a dependency and is more suitable for applications already using Redux.
Core logic and classic Bootstrap 3 theme for react-jsonschema-form
.
Explore the docs »
View Playground
·
Report Bug
·
Request Feature
Core logic and classic Bootstrap 3 theme for react-jsonschema-form
.
Bootstrap 3
To use the default Bootstrap 3 theme, add a Bootstrap 3 CSS tag to your HTML page:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
npm install @rjsf/core
import Form from '@rjsf/core';
See the general open issues.
Read our contributors' guide to get started.
rjsf team: https://github.com/orgs/rjsf-team/people
GitHub repository: https://github.com/rjsf-team/react-jsonschema-form
5.0.0-beta.9
uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)FieldErrorTemplate
to remove the explicit typing of the error
to string to support the two optionsTheme
to use the renamed ThemeProps
from @rjsf/core
uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)Theme
to use the renamed ThemeProps
from @rjsf/core
uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)FieldErrorTemplate
to remove the explicit typing of the error
to string to support the two optionsvalidateForm()
method on Form
, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/2755, https://github.com/rjsf-team/react-jsonschema-form/issues/2552, https://github.com/rjsf-team/react-jsonschema-form/issues/2381, https://github.com/rjsf-team/react-jsonschema-form/issues/2343, https://github.com/rjsf-team/react-jsonschema-form/issues/1006, https://github.com/rjsf-team/react-jsonschema-form/issues/246)WithThemeProps
to ThemeProps
to prevent another breaking-change by returning the type back to the name it had in version 4uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)ArrayField
to fall back to SchemaField
if ArraySchemaField
is not defined, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3131)Theme
to use the renamed ThemeProps
from @rjsf/core
uiSchema
appropriately to all of the IconButton
s and ArrayFieldItemTemplate
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)Theme
to use the renamed ThemeProps
from @rjsf/core
uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)Theme
to use the renamed ThemeProps
from @rjsf/core
uiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)FieldErrorTemplate
to use the children
variation of the List.Item
that supports ReactElementuiSchema
appropriately to all of the IconButton
s, ArrayFieldItemTemplate
and WrapIfAdditional
components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)FieldErrorProps
type to make it support an array of string and ReactElementIconButtonProps
type to add uiSchema
, adding the <T = any, F = any>
generics to it and the associated ButtonTemplates
in TemplatesType
AND added uiSchema
to ArrayFieldTemplateItemType
as well, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)custom-templates.md
file to add the missing asterisk to the new FieldErrorTemplate
and FieldHelpTemplate
validation.md
documentation to describe how to programmatically validate a formchakra-ui
custom uiSchema
documentation to make it clear they work on a per-field basis, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/2865)formElement
breaking-change documentation to the 5.x upgrade guide.md
ArraySchemaField
to better represent the updated implementation, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3131)FAQs
A simple React component capable of building HTML forms out of a JSON schema.
The npm package @rjsf/core receives a total of 286,651 weekly downloads. As such, @rjsf/core popularity was classified as popular.
We found that @rjsf/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.