npm.io
6.11.0 • Published 3 weeks ago

@rjsf/mui

Licence
Apache-2.0
Version
6.11.0
Deps
0
Size
604 kB
Vulns
0
Weekly
0
Stars
15.9K

Build Status npm npm downloads Contributors Apache 2.0 License


Logo

@rjsf/mui

Material UI theme, fields and widgets for react-jsonschema-form.
Explore the docs »

View Playground · Report Bug · Request Feature

Table of Contents

About The Project

Exports MUI version 5 theme, fields, and widgets for react-jsonschema-form.

product-screenshot

Built With

Getting Started

Prerequisites

NOTE: Material UI 7 requires React 18, so you will need to upgrade

  • @mui/material >= 7
  • @mui/icons-material >= 7
  • @emotion/react >= 11
  • @emotion/styled >= 11
  • @rjsf/core >= 6
  • @rjsf/utils >= 6
  • @rjsf/validator-ajv8 >= 6
yarn add @mui/material @mui/icons-material @emotion/react @emotion/styled @rjsf/core @rjsf/utils @rjsf/validator-ajv8
Installation
yarn add @rjsf/mui

Usage

Material UI version 7
import Form from '@rjsf/mui';

or

import { withTheme } from '@rjsf/core';
import { Theme } from '@rjsf/mui';

// Make modifications to the theme with your own fields and widgets

const Form = withTheme(Theme);
Customizing MUI-specific props

You can pass MUI-specific props (like sx, rjsfSlotProps, variant, etc.) directly to any MUI component rendered by a Template or Widget via ui:options in the uiSchema.

"myField": {
  "ui:options": {
    "mui": {
      "variant": "filled",
      "sx": {
        "backgroundColor": "background.paper"
      },
      "rjsfSlotProps": {
        "input": {
          "endAdornment": "kg"
        }
      }
    }
  }
}

For more details on available properties and rjsfSlotProps targets, see the Material UI Customization Documentation.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Read our contributors' guide to get started.

Contact

rjsf team: https://github.com/orgs/rjsf-team/people

GitHub repository: https://github.com/rjsf-team/react-jsonschema-form

Keywords