agentsclimarketplace

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

Install
npx -y skills add react-declarative/react-declarative-skills --skill react-declarative

Assembled 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 a handler and emit updates via onChange
  • payload prop 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 wantsRecommend
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 renderersOneSlotFactory / ListSlotFactory
Async action dedupuseSinglerunAction
Ordered async queueuseQueuedAction
Async data in componentuseAsyncValue
Batch progressuseAsyncProgress
Reactive observable listuseCollection
Route params in componentuseRouteParams

Reference files

Load these when you need deep detail on a specific area:

How-to guides (narrative explanations with full examples)

Load these for deeper "how does this work" context on cross-cutting topics:

Example schemas (real-world TypedField[] code)

Load these when you need a working example close to what the user is asking for:

Real-world project utilities

  • references/pagination-hooks-and-iterator-functions.md — useArrayPaginator, useOffsetPaginator, useBidOffsetPaginator, iterateUnion, iterateDocuments, iteratePromise, useColumnConfig, useGridAction, useMediaContext
  • references/ui-components.md — VirtualView (children must use forwardRef), ScrollView, Async, Breadcrumbs2, ActionMenu
  • references/hooks-and-modals.md — useQueryPagination (URL list filter persistence), useOne, usePrompt, useAlert, useModalManager, useActionModal, useOutletModal
  • references/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

  1. name maps directly to a data key — layout fields (Group, Paper, etc.) never need name
  2. Column values are stringscolumns: '6', not columns: 6
  3. handler can be async — no need for external loading state
  4. onChange fires with initial: true on first load — skip saves on initial emission
  5. payload is not form data — use it for user roles, feature flags; it does not trigger re-renders (use context prop if you need reactive context)
  6. isInvalid returns null for valid, string for error — returning null is required (not undefined)
  7. TypedField<Data, Payload> generics give full IntelliSense on field names and callbacks — always recommend using them
  8. OneTyped / ListTyped are stricter wrappers — prefer them in new code
  9. Playground: https://react-declarative-playground.github.io/ — paste a fields array to preview instantly

What ships with it: 41 files

292.7 KB alongside SKILL.md

evals/

1 more file not listed here. See all 41 in the repository.

Keep looking

Skills are one crate of 326,401. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.