| <!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>introduction | react-declarative</title><meta name="description" content="Documentation for react-declarative"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">react-declarative</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">react-declarative</a></li><li><a href="introduction.html">introduction</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="what-is-react-declarative-and-what-can-you-build" class="tsd-anchor"></a><h1 class="tsd-anchor-link">What is react-declarative and what can you build<a href="#what-is-react-declarative-and-what-can-you-build" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>react-declarative is a TypeScript React library that turns a <code>TypedField[]</code> JSON schema into fully functional forms, data grids, kanban boards, wizards, and application shells — without manual state wiring. You describe what you want using a JSON schema; the library handles rendering, validation, and state management automatically on top of Material UI (MUI) components.</p> |
| <a id="why-react-declarative" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Why react-declarative<a href="#why-react-declarative" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Most form libraries require you to write both a data schema and a UI schema separately. react-declarative merges them into a single <code>TypedField[]</code> array, which means less code and fewer places for data model drift to creep in.</p> |
| <blockquote> |
| <p><strong>Note:</strong> The key difference from <a href="https://jsonforms.io/docs/#how-does-it-work">jsonforms</a>: you do <strong>not</strong> need a separate JSON Schema for your data model. All validations live inside the UI schema, so your backend can return partial data (PATCH-style) and the form adapts automatically.</p> |
| </blockquote> |
| <p>react-declarative scales from a single embedded form to a full CRM or ERP — the same JSON schema pattern applies to every level.</p> |
| <a id="key-features" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Key features<a href="#key-features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p><strong><a href="docs_components_one.html">Forms (One)</a></strong></p> |
| <p>Render nested 12-column grid forms from a <code>TypedField[]</code> schema. Supports 40+ field types, inline validation, conditional visibility, and JSX injection.</p> |
| <p><strong><a href="docs_components_list.html">Data grid (List)</a></strong></p> |
| <p>Filterable, sortable, paginated data grid with built-in mobile layout. Columns, filters, actions, and row menus are all configured from JSON.</p> |
| <p><strong><a href="docs_components_scaffold.html">App shell (Scaffold)</a></strong></p> |
| <p>Material Design app shells with navigation groups, tabs, and action menus — configured from an <code>IScaffold2Group[]</code> array, not hand-written JSX.</p> |
| <p><strong><a href="https://react-declarative-playground.github.io/">Playground</a></strong></p> |
| <p>Try react-declarative in your browser without installing anything. Edit schemas live and see the output instantly.</p> |
| <a id="what-else-you-can-build" class="tsd-anchor"></a><h2 class="tsd-anchor-link">What else you can build<a href="#what-else-you-can-build" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Beyond forms and grids, react-declarative ships production-ready components for the full application lifecycle:</p> |
| <ul> |
| <li><strong>KanbanView</strong> — drag-and-drop kanban boards with real-time column updates</li> |
| <li><strong>WizardView</strong> — multi-step action wizards with MUI Stepper and nested routing</li> |
| <li><strong>VisibilityView / FeatureView</strong> — role-based UI visibility configured from feature flags</li> |
| <li><strong>VirtualView / InfiniteView</strong> — virtualized and infinite-scroll lists with transparent-API virtualization</li> |
| <li><strong>Async hooks</strong> — <code>useSinglerunAction</code>, <code>useQueuedAction</code>, <code>useAsyncValue</code>, <code>useAsyncProgress</code> for managing async UI state without boilerplate</li> |
| </ul> |
| <a id="typescript-intellisense" class="tsd-anchor"></a><h2 class="tsd-anchor-link">TypeScript IntelliSense<a href="#typescript-intellisense" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Every schema array is typed through <code>TypedField<Data, Payload></code>. Your IDE will autocomplete field property names, flag invalid <code>type</code> values, and surface validation errors at authoring time — not at runtime.</p> |
| <pre><code class="tsx"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">TypedField</span><span class="hl-1">, </span><span class="hl-2">FieldType</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'react-declarative'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">interface</span><span class="hl-1"> </span><span class="hl-7">IProfile</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">firstName</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-2">email</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-2">role</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">;</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-10">fields</span><span class="hl-1">: </span><span class="hl-7">TypedField</span><span class="hl-1"><</span><span class="hl-7">IProfile</span><span class="hl-1">>[] = [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">FieldType</span><span class="hl-1">.</span><span class="hl-2">Text</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">name:</span><span class="hl-1"> </span><span class="hl-3">'firstName'</span><span class="hl-1">, </span><span class="hl-17">// autocompleted from IProfile</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">'First name'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">];</span> |
| </code><button type="button">Copy</button></pre> |
|
|
| <a id="using-with-ai" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Using with AI<a href="#using-with-ai" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>react-declarative schemas are structured JSON, which makes them easy for LLMs to generate. There is a documented guide in the repository for prompting GPT-4 to produce form schemas automatically — see the <a href="https://github.com/react-declarative/react-declarative/tree/master/docs">docs folder</a> for details.</p> |
| <a id="next-steps" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Next steps<a href="#next-steps" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p><strong><a href="installation.html">Installation</a></strong></p> |
| <p>Install the package and peer dependencies in two commands.</p> |
| <p><strong><a href="quickstart.html">Quick start</a></strong></p> |
| <p>Build your first form and data grid in under five minutes.</p> |
| </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#what-is-react-declarative-and-what-can-you-build"><span>What is react-<wbr/>declarative and what can you build</span></a><ul><li><a href="#why-react-declarative"><span>Why react-<wbr/>declarative</span></a></li><li><a href="#key-features"><span>Key features</span></a></li><li><a href="#what-else-you-can-build"><span>What else you can build</span></a></li><li><a href="#typescript-intellisense"><span>Type<wbr/>Script <wbr/>Intelli<wbr/>Sense</span></a></li><li><a href="#using-with-ai"><span>Using with AI</span></a></li><li><a href="#next-steps"><span>Next steps</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">react-declarative</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html> |
|
|