Material UI theme integration for react-jsonschema-form providing dual v4/v5 compatibility with Material Design components, widgets, fields, and themes for JSON schema-based forms.
—
Complete set of form input widgets styled with Material UI components for different data types and input methods. All widgets implement the WidgetProps interface from @rjsf/core.
Basic text input widget using Material UI TextField component.
/**
* Text input widget using TextField component with support for different input types
* @param props - WidgetProps with text input specific options
* @returns JSX.Element
*/
declare const TextWidget: React.ComponentType<WidgetProps>;Usage:
"string"inputType optionMulti-line text input widget for longer text content.
/**
* Multi-line text input widget using TextField with multiline prop
* @param props - WidgetProps with textarea specific options (rows, etc.)
* @returns JSX.Element
*/
declare const TextareaWidget: React.ComponentType<WidgetProps>;Usage:
"string" with ui:widget: "textarea"Password input widget with hidden text display.
/**
* Password input widget with hidden text using TextField type="password"
* @param props - WidgetProps for password input
* @returns JSX.Element
*/
declare const PasswordWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "password"Email input widget with built-in validation.
/**
* Email input widget with validation using TextField type="email"
* @param props - WidgetProps for email input
* @returns JSX.Element
*/
declare const EmailWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "email"URL input widget with validation for web addresses.
/**
* URL input widget with validation using TextField type="url"
* @param props - WidgetProps for URL input
* @returns JSX.Element
*/
declare const URLWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "uri"Dropdown selection widget for choosing from predefined options.
/**
* Dropdown select input using TextField with select prop and MenuItem options
* @param props - WidgetProps with enum options or oneOf schema
* @returns JSX.Element
*/
declare const SelectWidget: React.ComponentType<WidgetProps>;Usage:
enum property or oneOf with title/const pairsExample:
const schema = {
type: "string",
enum: ["option1", "option2", "option3"],
enumNames: ["Option 1", "Option 2", "Option 3"]
};Radio button group for single selection from multiple options.
/**
* Radio button group using RadioGroup and FormControlLabel components
* @param props - WidgetProps with enum options
* @returns JSX.Element
*/
declare const RadioWidget: React.ComponentType<WidgetProps>;Usage:
enum with ui:widget: "radio"Single checkbox for boolean values.
/**
* Single checkbox input using Checkbox and FormControlLabel
* @param props - WidgetProps for boolean input
* @returns JSX.Element
*/
declare const CheckboxWidget: React.ComponentType<WidgetProps>;Usage:
"boolean"Multiple checkbox selection for array values.
/**
* Multiple checkbox selection using FormGroup with Checkbox controls
* @param props - WidgetProps with enum options for array type
* @returns JSX.Element
*/
declare const CheckboxesWidget: React.ComponentType<WidgetProps>;Usage:
"array" with items.enum and uniqueItems: trueDate input widget for date selection.
/**
* Date input widget using TextField with type="date"
* @param props - WidgetProps for date input
* @returns JSX.Element
*/
declare const DateWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "date"Date and time input widget for datetime selection.
/**
* Date and time input widget using TextField with type="datetime-local"
* @param props - WidgetProps for datetime input
* @returns JSX.Element
*/
declare const DateTimeWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "date-time"Numeric input with up/down controls for integer values.
/**
* Numeric input with up/down controls using TextField type="number"
* @param props - WidgetProps for integer input
* @returns JSX.Element
*/
declare const UpDownWidget: React.ComponentType<WidgetProps>;Usage:
"integer"Range slider widget for numeric values within a specific range.
/**
* Range slider input using Material UI Slider component
* @param props - WidgetProps with minimum/maximum values
* @returns JSX.Element
*/
declare const RangeWidget: React.ComponentType<WidgetProps>;Usage:
"integer" or "number" with ui:widget: "range"minimum, maximum, multipleOf schema propertiesColor picker widget for color selection.
/**
* Color picker widget using TextField with type="color"
* @param props - WidgetProps for color input
* @returns JSX.Element
*/
declare const ColorWidget: React.ComponentType<WidgetProps>;Usage:
"string" with format: "color"Form submit button with Material UI styling.
/**
* Form submit button using Material UI Button component
* @param props - WidgetProps for submit button
* @returns JSX.Element
*/
declare const SubmitButton: React.ComponentType<WidgetProps>;Usage:
All widgets receive the WidgetProps interface:
interface WidgetProps {
/** Unique identifier for the widget */
id: string;
/** Current value of the widget */
value: any;
/** Display label for the widget */
label?: string;
/** Change handler called when value changes */
onChange: (value: any) => void;
/** Blur handler called when widget loses focus */
onBlur?: (id: string, value: any) => void;
/** Focus handler called when widget gains focus */
onFocus?: (id: string, value: any) => void;
/** Widget-specific options from UI schema */
options?: { [key: string]: any };
/** JSON Schema for this field */
schema: JSONSchema7;
/** UI Schema for this field */
uiSchema?: UiSchema;
/** Whether the widget is readonly */
readonly?: boolean;
/** Whether the widget is disabled */
disabled?: boolean;
/** Whether the field is required */
required?: boolean;
/** Whether multiple values are allowed */
multiple?: boolean;
/** Array of validation error messages */
rawErrors?: string[];
/** Form context object */
formContext?: any;
/** Whether the widget should autofocus */
autofocus?: boolean;
/** Placeholder text for the widget */
placeholder?: string;
}All widgets are available as a collection:
interface WidgetCollection {
CheckboxWidget: React.ComponentType<WidgetProps>;
CheckboxesWidget: React.ComponentType<WidgetProps>;
ColorWidget: React.ComponentType<WidgetProps>;
DateWidget: React.ComponentType<WidgetProps>;
DateTimeWidget: React.ComponentType<WidgetProps>;
EmailWidget: React.ComponentType<WidgetProps>;
PasswordWidget: React.ComponentType<WidgetProps>;
RadioWidget: React.ComponentType<WidgetProps>;
RangeWidget: React.ComponentType<WidgetProps>;
SelectWidget: React.ComponentType<WidgetProps>;
SubmitButton: React.ComponentType<WidgetProps>;
TextWidget: React.ComponentType<WidgetProps>;
TextareaWidget: React.ComponentType<WidgetProps>;
URLWidget: React.ComponentType<WidgetProps>;
UpDownWidget: React.ComponentType<WidgetProps>;
}
declare const Widgets: WidgetCollection;import { Widgets } from "@rjsf/material-ui/v5";
import Form from "@rjsf/material-ui/v5";
const customWidgets = {
...Widgets,
MyCustomWidget: ({ value, onChange }) => (
<input value={value} onChange={(e) => onChange(e.target.value)} />
),
};
function FormWithCustomWidget() {
return (
<Form
schema={schema}
widgets={customWidgets}
uiSchema={{
myField: { "ui:widget": "MyCustomWidget" }
}}
/>
);
}const uiSchema = {
description: {
"ui:widget": "textarea",
"ui:options": {
rows: 5,
placeholder: "Enter description..."
}
},
rating: {
"ui:widget": "range",
"ui:options": {
step: 0.5
}
}
};Install with Tessl CLI
npx tessl i tessl/npm-rjsf--material-ui