Advanced usages and examples for @ui-schema/react in TypeScript, with @mui, see demo-cra for simpler non-TS examples.
Files in src:
- main.tsx provider setup, e.g.
UIMetaProvider - routes.ts
- App.tsx layout and router setup
- components/UISchema.tsx UI-Schema binding setup
- example pages:
- pages/PageSimpleForm.tsx, automatic rendered, usage of
WidgetCountrySelect - pages/PageCustomForm.tsx, custom rendered, usage of
WidgetCountrySelect - pages/PageCustomUpload.tsx, custom rendered, native file upload widget
- pages/PageRefForm.tsx, example of
$refwith embedded$defs - pages/PageRefRemoteForm.tsx, example of
$refwith loading remote schema resources
- pages/PageSimpleForm.tsx, automatic rendered, usage of
- widget in: Widgets/
- WidgetCountrySelect.tsx, uses an API to populate the
Selectoptions
- WidgetCountrySelect.tsx, uses an API to populate the
Run on CodeSandbox or StackBlitz.
Explore more:
Install dependencies:
npm iStart dev server:
npm startCreate bundle:
npm run buildFor tests first install a playwright browser:
npx playwright install chromium --with-depsThen run tests:
npm testOr run tests in watch mode:
npm run tdd