React declarative
Skill react-declarative/react-declarative-skills/skills/react-declarative
Expert assistant for the `react-declarative` TypeScript/React library built on top of MUI v5. Use this skill whenever the user: - Asks how to build a form, data grid, kanban board, wizard, or app shell with react-declarative - Asks about any react-declarative API: TypedField, FieldType, One, OneTyped, List, ListTyped, Scaffold2, KanbanView, WizardView - Asks about field types (Text, Combo, Items, Switch, Checkbox, Rating, Slider, File, Date, etc.) - Asks about layout containers (Group, Paper, Outline, Expansion, Tabs, Condition, Fragment, Layout) - Asks about state management in react-declarative: handler, onChange, payload, isInvalid, isVisible, isDisabled - Asks about async hooks: useSinglerunAction, useQueuedAction, useAsyncValue, useAsyncProgress, useAsyncAction - Asks about routing: Switch component, ISwitchItem, useRouteParams, useRouteItem, parseRouteUrl - Asks about reactive programming: Subject, BehaviorSubject, Source, useSubject, useChangeSubject - Asks about dependency injection: provide, inject, createServiceManager, IService - Asks about slot factory customization: OneSlotFactory, ListSlotFactory - Has errors in react-declarative code and needs help fixing them - Wants to scaffold a project or understand project structure - Asks about AI-assisted form generation with TypedField schemas - Imports from `react-declarative` in their code Trigger even if the user just shows a `.tsx` file using One/List/Scaffold2/KanbanView and asks a question about it.From its SKILL.md
npx -y skills add react-declarative/react-declarative-skills --skill react-declarativeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
12.5 KB, ~2.6k tokens by cl100k_base, as published. Nobody here has run it
react-declarative Expert
react-declarative is a TypeScript React library that turns TypedField[] JSON schemas into fully functional MUI v5-based forms, data grids, kanban boards, wizards, and app shells — with automatic state management, no manual useState/useEffect wiring needed.
Core concepts
- Schema-first: UI is described as plain
TypedField[]arrays, not JSX trees <One />renders forms;<List />renders data grids; both read from ahandlerand emit updates viaonChangepayloadprop carries external context (user roles, feature flags) into every field callback without polluting form data- All field callbacks (
isInvalid,isVisible,isDisabled,compute) receive the full data object — cross-field logic is built-in
Quick decision guide
| User wants | Recommend |
|---|---|
| A form | <One /> / <OneTyped /> with TypedField[] |
| A data grid | <List /> / <ListTyped /> with IColumn[] |
| An app shell | <Scaffold2 /> / <Scaffold3 /> with IScaffold2Group[] |
| A kanban board | <KanbanView /> with IBoardColumn[] + IBoardItem[] |
| A multi-step wizard | <WizardView /> with IWizardStep[] + IWizardOutlet[] |
| Custom field renderers | OneSlotFactory / ListSlotFactory |
| Async action dedup | useSinglerunAction |
| Ordered async queue | useQueuedAction |
| Async data in component | useAsyncValue |
| Batch progress | useAsyncProgress |
| Reactive observable list | useCollection |
| Route params in component | useRouteParams |
Reference files
Load these when you need deep detail on a specific area:
references/installation.md— install, peer deps, tsconfig, first form/grid, Next.js/Vite notesreferences/one-form.md—<One />props, TypedField schema, field callbacks, reloadSubject, apiRefreferences/state-management.md— handler, onChange/initial flag, payload vs context, isInvalid/isVisible/compute, dirty, defaultValuereferences/list-grid.md—<List />props, IColumn, ColumnType, filters, actions, chips, rowActions, operationsreferences/field-types.md— All FieldType values with examples (Text, Combo, Items, Switch, Slider, File, Component, Init, Phony…)references/layout-types.md— All layout containers (Group, Paper, Tabs, Condition, Fragment, Box, Layout…)references/components.md— Scaffold2, KanbanView, WizardViewreferences/hooks.md— Async hooks (useSinglerunAction, useQueuedAction, useAsyncValue…) + navigation hooks + useCollection/useModelreferences/reactive.md— Subject, BehaviorSubject, EventEmitter, useSubject, useChangeSubject, Source pipelinesreferences/routing.md— Switch router, ISwitchItem, guards, prefetch/unload, redirects, OutletView, useRouteParamsreferences/dependency-injection.md— provide/inject, TYPES symbols, scoped containers, route lifecycle with DIreferences/slot-factory.md— OneSlotFactory, ListSlotFactory, all slot interfaces, react-declarative-mantinereferences/advanced.md— AI-assisted form generation, playground, prompt workflow, reference sample list
How-to guides (narrative explanations with full examples)
Load these for deeper "how does this work" context on cross-cutting topics:
references/guide-async-data.md— choosing between handler/useSinglerunAction/useQueuedAction/useAsyncProgress/useAsyncValue/ActionButtonreferences/guide-conditional-fields.md— isVisible vs FieldType.Condition vs hidden prop, isDisabled, isReadonly, payload for RBACreferences/guide-custom-fields.md— FieldType.Component write-back, OneSlotFactory slot interfaces, when to use eachreferences/guide-form-validation.md— isInvalid, cross-field rules, async validation, isIncorrect, dirty flag, getAvailableFieldsreferences/guide-routing.md— Switch setup, guards, prefetch/unload, redirects with params, OutletView, useRouteParamsreferences/guide-architecture.md— full project architecture: folder structure, DI wiring (types/config/ioc), DB/View service layers, declarative assets, route config, modal pattern, HOCs, entry point providers stack, checklist for adding a new entity
Example schemas (real-world TypedField[] code)
Load these when you need a working example close to what the user is asking for:
references/login_form_example.md— centered login card with email/password and action feedbackreferences/account_info_example.md— account settings page with profile fields and permissionsreferences/profile_card_form_example.md— avatar layout, nested groups, Component injectionreferences/settings_page_form_example.md— settings page with Switch, Slider, Rating, Progressreferences/adaptive_form_example.md— responsive form with desktopColumns/tabletColumns/phoneColumns breakpointsreferences/variant_form_example.md— conditional field visibility with isVisible / FieldType.Conditionreferences/order_info_form_example.md— multi-section order form with Paper, Date, Comboreferences/product_shape_form_example.md— product data form with nested structurereferences/rate_card_form_example.md— rate card / pricing formreferences/crypto_form_example.md— crypto / financial data entry formreferences/machine_learning_form_example.md— ML model configuration formreferences/dashboard_form_example.md— dashboard layout with KPI cards and read-only display panelsreferences/kpi_review_example.md— KPI review / metrics display formreferences/google_forms_like_example.md— survey-style form similar to Google Formsreferences/custom_form_example.md— custom layout with FieldType.Layout / FieldType.Componentreferences/gallery_of_controls_example.md— every FieldType in one form; use as a lookup when a less common field type is neededreferences/typography_example.md— typography and display-only fields (FieldType.Typography, Line, Icon)
Real-world project utilities
references/pagination-hooks-and-iterator-functions.md— useArrayPaginator, useOffsetPaginator, useBidOffsetPaginator, iterateUnion, iterateDocuments, iteratePromise, useColumnConfig, useGridAction, useMediaContextreferences/ui-components.md— VirtualView (children must use forwardRef), ScrollView, Async, Breadcrumbs2, ActionMenureferences/hooks-and-modals.md— useQueryPagination (URL list filter persistence), useOne, usePrompt, useAlert, useModalManager, useActionModal, useOutletModalreferences/view-components.md— OutletView (entity edit shell), TabsView (tabbed layout), WizardView + WizardContainer + WizardNavigation, CalendarView (month calendar with handler/renderItem/BeforeDayHeader/dotSide)
Minimal working examples
Form with One
import { One, TypedField, FieldType } from 'react-declarative';
interface IUser { firstName: string; email: string; role: string; }
const fields: TypedField<IUser>[] = [
{ type: FieldType.Text, name: 'firstName', title: 'First name' },
{ type: FieldType.Text, name: 'email', title: 'Email',
isInvalid: ({ email }) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) ? null : 'Invalid email' },
{ type: FieldType.Combo, name: 'role', title: 'Role', itemList: ['admin', 'editor', 'viewer'] },
];
export const UserForm = () => (
<One<IUser>
fields={fields}
handler={async () => fetchUser()}
onChange={(data, initial) => { if (!initial) save(data); }}
/>
);
Data grid with ListTyped
import { ListTyped, IColumn, ColumnType, useArrayPaginator } from 'react-declarative';
const columns: IColumn<{}, IRow>[] = [
{ type: ColumnType.Text, field: 'name', headerName: 'Name', width: '200px', sortable: true },
{ type: ColumnType.CheckBox, field: 'active', headerName: 'Active', width: '80px' },
];
export const UserGrid = () => (
<ListTyped withSearch withArrowPagination columns={columns} handler={useArrayPaginator(rows)} />
);
Installation
npm install --save react-declarative tss-react @mui/material @emotion/react @emotion/styled
Lite variant (forms only, smaller footprint):
npm install --save react-declarative-lite
When you're stuck — reference implementation
If something isn't working, the patterns are unclear, or the documentation doesn't cover your case, clone the reference CRM application — it's a complete real-world project using react-declarative end-to-end:
git clone https://github.com/react-declarative/react-pocketbase-crm.git
It demonstrates: routing with Switch + Scaffold2, forms with One, data grids with List, dependency injection with provide/inject, real-time with Subject/BehaviorSubject, and full TypeScript generics throughout. Browse src/ to find working examples of any pattern you need.
Key rules when generating code
namemaps directly to a data key — layout fields (Group, Paper, etc.) never needname- Column values are strings —
columns: '6', notcolumns: 6 handlercan be async — no need for external loading stateonChangefires withinitial: trueon first load — skip saves on initial emissionpayloadis not form data — use it for user roles, feature flags; it does not trigger re-renders (usecontextprop if you need reactive context)isInvalidreturnsnullfor valid, string for error — returningnullis required (notundefined)TypedField<Data, Payload>generics give full IntelliSense on field names and callbacks — always recommend using themOneTyped/ListTypedare stricter wrappers — prefer them in new code- Playground: https://react-declarative-playground.github.io/ — paste a
fieldsarray to preview instantly
What ships with it: 41 files
292.7 KB alongside SKILL.md
evals/
- evals.json9.9 KB
references/
- account_info_example.md3.7 KB
- adaptive_form_example.md2.6 KB
- advanced.md7.2 KB
- components.md9.1 KB
- crypto_form_example.md1.5 KB
- custom_form_example.md1.3 KB
- dashboard_form_example.md15.3 KB
- dependency-injection.md2.1 KB
- field-types.md6.1 KB
- gallery_of_controls_example.md7.3 KB
- google_forms_like_example.md11.6 KB
- guide-architecture.md15.5 KB
- guide-async-data.md4.1 KB
- guide-conditional-fields.md3.2 KB
- guide-custom-fields.md3.6 KB
- guide-form-validation.md3.1 KB
- guide-routing.md4.2 KB
- hooks-and-modals.md12.4 KB
- hooks.md6.3 KB
- installation.md3.4 KB
- kpi_review_example.md4.1 KB
- layout-types.md5.7 KB
- list-grid.md6.4 KB
- login_form_example.md2.3 KB
- machine_learning_form_example.md7.3 KB
- one-form.md6.1 KB
- order_info_form_example.md5.3 KB
- pagination-hooks-and-iterator-functions.md9.0 KB
- product_shape_form_example.md8.7 KB
- profile_card_form_example.md6.6 KB
- rate_card_form_example.md3.2 KB
- reactive.md3.2 KB
- routing.md3.3 KB
- settings_page_form_example.md7.9 KB
- slot-factory.md3.8 KB
- state-management.md3.9 KB
- typography_example.md3.2 KB
- ui-components.md12.2 KB
- variant_form_example.md41.6 KB
1 more file not listed here. See all 41 in the repository.