Skip to content

Create a withTheme higher-order component #1222

@epicfaace

Description

@epicfaace

Ideally, we should have a withTheme HOC in which fields, widgets, and/or templates can be passed -- this can be used to implement custom themes.

This was implemented in #1013, but that included several other breaking changes -- so I'd like to see a PR which just implements the withTheme component so it can be added to the library.

Example usage:

import withTheme from 'react-jsonschema-form/lib/components/withTheme'; import widgets from './my-theme/widgets'; import templates from './my-theme/templates'; const Form = withTheme('MyTheme', { widgets, templates }); 

I'm listing the popular / currently maintained libraries that fork off of react-jsonschema-form and implement a UI framework other than bootstrap 3, so that the maintainers of those repos are aware of the progress on this issue -- or if anyone wants to jump in and do this, that would be great! @peterkelly @cwhatley @vip-git @SelfKeyFoundation @eddyzhang1986 @TwoAbove @nilportugues

BS4
https://github.com/peterkelly/react-jsonschema-form-bs4
Material
https://github.com/cwhatley/material-ui-react-jsonschema-form
https://github.com/vip-git/react-jsonschema-form-material-ui
https://github.com/SelfKeyFoundation/react-jsonschema-form-material-theme
https://github.com/TwoAbove/jsonschema-form-for-material-ui
Antd
https://github.com/eddyzhang1986/antd-jsonschema-form
Semantic UI
https://github.com/nilportugues/react-jsonschema-form-semanticui

See #899

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions