<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Blog — React Resource View</title>
  <id>https://hermez.dev/react-resource-view/blog/</id>
  <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/"/>
  <link rel="self" type="application/atom+xml" href="https://hermez.dev/react-resource-view/blog/feed.xml"/>
  <updated>2026-11-26T00:00:00Z</updated>
  <author><name>Hermez</name><uri>https://hermez.dev</uri></author>
  <entry>
    <title>Connect API Platform to a React admin panel: lists, forms and real time with React Resource View</title>
    <id>https://hermez.dev/react-resource-view/blog/connect-api-platform-to-a-react-admin/</id>
    <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/connect-api-platform-to-a-react-admin/"/>
    <published>2026-11-26T00:00:00Z</published>
    <updated>2026-11-26T00:00:00Z</updated>
    <summary>A React and TypeScript admin panel for an API Platform API (JSON-LD, Hydra) without writing the CRUD screens: types generated from OpenAPI, a resource declared once, an admin menu and Mercure live updates.</summary>
    <category term="Use case"/>
    <category term="API Platform"/>
    <category term="React"/>
    <category term="Admin panel"/>
    <category term="TypeScript"/>
    <content type="html">&lt;p&gt;You have an API built with API Platform and you need an admin panel: list records, filter them, create, edit and delete them. The usual reflex is to write a table, then forms, then wire up Hydra pagination, IRIs and validation messages, one resource after another. This article shows the shortest path with React Resource View, which speaks JSON-LD and Hydra out of the box: from the API to a React admin in TypeScript, with generated types instead of copied ones.&lt;/p&gt;
&lt;p&gt;The example manages &lt;code&gt;articles&lt;/code&gt;, with fictional data. It assumes an API running on &lt;code&gt;https://api.example.com&lt;/code&gt; that exposes &lt;code&gt;/api/articles&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-the-library-understands-about-api-platform&quot;&gt;What the library understands about API Platform&lt;/h2&gt;
&lt;p&gt;An API Platform collection responds with &lt;code&gt;application/ld+json&lt;/code&gt;: records are in &lt;code&gt;member&lt;/code&gt;, their count in &lt;code&gt;totalItems&lt;/code&gt;, each record carries an &lt;code&gt;@id&lt;/code&gt; (its IRI, for example &lt;code&gt;/api/articles/7&lt;/code&gt;), and a validation error comes back as &lt;code&gt;violations&lt;/code&gt;. React Resource View&amp;#39;s JSON-LD dialect reads all of that: pagination (&lt;code&gt;page&lt;/code&gt; and &lt;code&gt;itemsPerPage&lt;/code&gt;), IRIs, violations shown on the matching fields, and the Mercure channel for real time. There is nothing to configure to turn it on: it is the default dialect.&lt;/p&gt;
&lt;h2 id=&quot;1-install-and-configure-api-access&quot;&gt;1. Install and configure API access&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;npm i react-resource-view react-data-form react-mini-i18n resource-registry&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, once, before the first render:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { configureApi } from &amp;quot;react-resource-view&amp;quot;

configureApi({
  baseUrl: &amp;quot;https://api.example.com&amp;quot;,
  getAuthToken: () =&amp;gt; localStorage.getItem(&amp;quot;token&amp;quot;) ?? undefined,
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The token is added to every request, and passed to Mercure as well. If your application already configures &lt;code&gt;jsonld-api-client&lt;/code&gt; with &lt;code&gt;configureClient&lt;/code&gt;, it keeps working as is: &lt;code&gt;configureApi&lt;/code&gt; picks up its settings when you don&amp;#39;t give it any.&lt;/p&gt;
&lt;h2 id=&quot;2-types-that-come-from-the-api&quot;&gt;2. Types that come from the API&lt;/h2&gt;
&lt;p&gt;Copying the &lt;code&gt;Article&lt;/code&gt; interface by hand is the best way to let it drift away from the API. API Platform publishes its OpenAPI schema; the &lt;a href=&quot;https://github.com/hermez-agency/api-dumper&quot;&gt;api-dumper&lt;/a&gt; tool generates TypeScript types from it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm add -D api-dumper typescript&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;// api-dumper.config.ts
import { defineConfig } from &amp;quot;api-dumper&amp;quot;

export default defineConfig({
  source: &amp;quot;https://api.example.com/api/docs.jsonopenapi&amp;quot;,
  outDir: &amp;quot;src/api-schema&amp;quot;,
  preset: &amp;quot;api-platform&amp;quot;,
  strip: { contentTypes: [&amp;quot;text/csv&amp;quot;] },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;npx api-dumper&lt;/code&gt; writes the types to &lt;code&gt;src/api-schema/&lt;/code&gt;; &lt;code&gt;npx api-dumper --check&lt;/code&gt; fails in CI when they no longer match the API. This step is optional: without it, just declare an interface by hand.&lt;/p&gt;
&lt;h2 id=&quot;3-declare-the-resource&quot;&gt;3. Declare the resource&lt;/h2&gt;
&lt;p&gt;A declaration says where the resource lives and which fields it has. Those fields are both the table columns and the fields of the create and edit forms:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { createViewResource, layout } from &amp;quot;react-resource-view&amp;quot;
import type { components } from &amp;quot;./api-schema/api-schema&amp;quot;

// The item is typed with the shape the API returns: in JSON-LD, it carries &amp;quot;@id&amp;quot;.
type Article = components[&amp;quot;schemas&amp;quot;][&amp;quot;Article.jsonld&amp;quot;]

export const articles = createViewResource&amp;lt;Article&amp;gt;(&amp;quot;articles&amp;quot;, {
  name: &amp;quot;Articles&amp;quot;,
  path: &amp;quot;/api/articles&amp;quot;,
  realtime: true,
  form: {
    inputs: {
      title: { label: &amp;quot;Titre&amp;quot;, required: true },
      author: { label: &amp;quot;Auteur&amp;quot; },
    },
  },
  views: {
    list: {
      filters: { inputs: { title: { label: &amp;quot;Chercher un titre&amp;quot; } } },
      layouts: [layout.table(), layout.cards({ columns: 3 })],
    },
  },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The keys of &lt;code&gt;form.inputs&lt;/code&gt; are checked against the &lt;code&gt;Article&lt;/code&gt; type: a field that does not exist in the schema becomes a TypeScript error, not an empty column found during QA. The title search filter (&amp;quot;Chercher un titre&amp;quot;) is sent to API Platform as a query parameter (&lt;code&gt;title=…&lt;/code&gt;), so it assumes the matching filter is enabled on the API side, and it is written to the URL: a copied link reproduces the same list.&lt;/p&gt;
&lt;p&gt;The list is shown as a table or as cards, as the user chooses, without reloading the data:&lt;/p&gt;
&lt;figure data-width=&quot;wide&quot; class=&quot;mt-10&quot;&gt;&lt;div class=&quot;overflow-hidden rounded-xl border border-border bg-card&quot;&gt;&lt;img src=&quot;/react-resource-view/blog/brancher-api-platform-react-back-office-playground.png&quot; alt=&quot;The Articles list in the playground: layout switcher, filter bar and editable table, with demo data&quot; class=&quot;block h-auto w-full&quot; loading=&quot;lazy&quot;&gt;&lt;/div&gt;&lt;figcaption class=&quot;mt-3 text-sm leading-6 text-muted-foreground&quot;&gt;The React Resource View playground, with fictional articles&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;4-a-menu-and-an-admin-page&quot;&gt;4. A menu and an admin page&lt;/h2&gt;
&lt;p&gt;A resource&amp;#39;s screens live in a &lt;em&gt;scope&lt;/em&gt;, which declares its resources and wraps their views in a side menu, a breadcrumb and, on mobile, a bottom bar:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { createAdminLayout, type ScopeInterface } from &amp;quot;react-resource-view&amp;quot;
import { articles } from &amp;quot;./articles&amp;quot;

export const adminScope: ScopeInterface = {
  name: &amp;quot;admin&amp;quot;,
  label: &amp;quot;Back-office&amp;quot;,
  decoratorComponent: createAdminLayout({}),
  resources: [articles],
  menu: &amp;quot;auto&amp;quot;, // one entry per resource
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Adding a second resource means declaring it and adding it to &lt;code&gt;resources&lt;/code&gt;: the menu, routes and links follow.&lt;/p&gt;
&lt;h2 id=&quot;5-validation-errors-in-the-right-place&quot;&gt;5. Validation errors in the right place&lt;/h2&gt;
&lt;p&gt;When API Platform rejects a record, it responds with &lt;code&gt;violations&lt;/code&gt;: a list of &lt;code&gt;propertyPath&lt;/code&gt; values and messages. The dialect attaches each one to the form field with that name. There is no code to write for an &lt;code&gt;Assert\NotBlank&lt;/code&gt; constraint set on the PHP side to show up under the &amp;quot;title&amp;quot; field.&lt;/p&gt;
&lt;h2 id=&quot;6-real-time-with-mercure&quot;&gt;6. Real time with Mercure&lt;/h2&gt;
&lt;p&gt;In the declaration above, &lt;code&gt;realtime: true&lt;/code&gt; is enough: the list subscribes to the resource&amp;#39;s Mercure topic and refetches when the API publishes a change. Two useful details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the topic is only built for a &lt;code&gt;path&lt;/code&gt; under &lt;code&gt;/api/&lt;/code&gt;, the prefix that identifies an IRI;&lt;/li&gt;
&lt;li&gt;if the hub responds with an HTTP error (a &lt;code&gt;401&lt;/code&gt; after the cookie expires, a &lt;code&gt;502&lt;/code&gt; during a deployment), the connection is reopened after 1 s, 2 s, 4 s… up to 30 s, and the views refetch as soon as the hub is back.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A private hub on another domain needs cookies: &lt;code&gt;realtime: { withCredentials: true }&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-you-end-up-with&quot;&gt;What you end up with&lt;/h2&gt;
&lt;p&gt;With one configuration, one declaration and one scope, the admin panel lists, filters, creates, edits and deletes the articles of your API Platform API, with types that follow the schema, two layouts and live updates. Permissions (&lt;code&gt;permissions: { delete: … }&lt;/code&gt;), other layouts (board, calendar, timeline) and custom actions are declared in the same place, when you need them.&lt;/p&gt;
&lt;p&gt;If your API is not API Platform, the declaration does not change: you swap the dialect in &lt;code&gt;configureApi&lt;/code&gt;, for example for &lt;code&gt;strapiDialect()&lt;/code&gt;, &lt;code&gt;supabaseDialect()&lt;/code&gt;, &lt;code&gt;springDialect()&lt;/code&gt; or &lt;code&gt;restDialect()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;going-further&quot;&gt;Going further&lt;/h2&gt;
&lt;p&gt;Install the library with &lt;code&gt;npm i react-resource-view&lt;/code&gt;, then follow the &lt;a href=&quot;/react-resource-view/docs/resource-view/quickstart/&quot;&gt;quickstart&lt;/a&gt;. The useful pages for this case:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/react-resource-view/docs/resource-view/backends/&quot;&gt;backends and dialects&lt;/a&gt;, for the API settings;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/react-resource-view/docs/resource-view/openapi-types/&quot;&gt;typing resources from OpenAPI&lt;/a&gt;, for the full api-dumper recipe;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/react-resource-view/docs/resource-view/admin-layout/&quot;&gt;the admin layout&lt;/a&gt;, for the menu, slots and theme.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code is on &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view&quot;&gt;GitHub&lt;/a&gt;, under the MIT license.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A Hermez product — &lt;a href=&quot;https://hermez.dev&quot;&gt;hermez.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>React Resource View 2.2: a &quot;Shown fields&quot; menu for every list in your React admin panel</title>
    <id>https://hermez.dev/react-resource-view/blog/react-resource-view-2-2-visible-fields/</id>
    <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/react-resource-view-2-2-visible-fields/"/>
    <published>2026-11-26T00:00:00Z</published>
    <updated>2026-11-26T00:00:00Z</updated>
    <summary>React Resource View 2.2 adds a menu to every list of your React and TypeScript admin panel to hide fields in the table, cards, board or calendar, with the choice kept per resource and optionally stored in your API.</summary>
    <category term="What's new"/>
    <category term="React"/>
    <category term="Admin panel"/>
    <category term="TypeScript"/>
    <content type="html">&lt;p&gt;React Resource View 2.2.0 is out on npm. It fixes an annoyance every React admin panel runs into: a resource has fifteen fields, nobody reads more than five, and everyone wants to see only their own five. From now on, the reader decides what the list shows, in any layout, without you writing any code. No migration is needed.&lt;/p&gt;
&lt;h2 id=&quot;before-hideable-columns-but-only-in-the-table&quot;&gt;Before: hideable columns, but only in the table&lt;/h2&gt;
&lt;p&gt;Up to 2.1, the table had a &amp;quot;Properties&amp;quot; menu for hiding columns. Handy, but limited to &lt;code&gt;layout.table()&lt;/code&gt;: if your list also offered cards, a board or a calendar, those layouts showed every field, whatever the reader had picked. And the preference was lost when switching from one layout to another.&lt;/p&gt;
&lt;h2 id=&quot;after-one-menu-next-to-the-filters-applied-everywhere&quot;&gt;After: one menu next to the filters, applied everywhere&lt;/h2&gt;
&lt;p&gt;In 2.2, a &amp;quot;Shown fields&amp;quot; menu appears next to the filters of every list, with a checkbox per declared field. Uncheck a field and it disappears from the table, the cards, the board, the calendar, the gallery, the items and the split view. The same preference applies to all seven layouts, because it is kept per resource, not per layout.&lt;/p&gt;
&lt;p&gt;The menu is on by default. For an existing resource there is nothing to change: update the package and it is there. To configure it, everything goes through &lt;code&gt;views.list.fields&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { createViewResource, layout } from &amp;quot;react-resource-view&amp;quot;

export const tasks = createViewResource&amp;lt;Task&amp;gt;(&amp;quot;tasks&amp;quot;, {
  name: &amp;quot;Tasks&amp;quot;,
  path: &amp;quot;/api/tasks&amp;quot;,
  form: { inputs: TASK_FIELDS },
  views: {
    list: {
      layouts: [layout.table(), layout.board({ groupBy: &amp;quot;status&amp;quot; })],
      fields: {
        toggle: true, // the &amp;quot;Shown fields&amp;quot; menu: on by default
        persist: &amp;quot;local&amp;quot;, // where to keep the choice; false: until the reader leaves the list
        hidden: [&amp;quot;notes&amp;quot;, &amp;quot;user.email&amp;quot;], // hidden until the reader shows them
      },
    },
  },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The three options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;toggle&lt;/code&gt;: whether to show the menu. &lt;code&gt;false&lt;/code&gt; removes it, for a list whose fields are fixed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;persist&lt;/code&gt;: &lt;code&gt;&amp;quot;local&amp;quot;&lt;/code&gt; (the default) keeps the choice in the browser; &lt;code&gt;false&lt;/code&gt; keeps it only while the list stays open.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hidden&lt;/code&gt;: the fields hidden on first display. The declaration sets the starting point; the reader can show them, and their choice wins from then on.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;nested-fields-down-to-the-exact-level&quot;&gt;Nested fields, down to the exact level&lt;/h3&gt;
&lt;p&gt;A field is a data key, and nested keys are written with dots. Hiding &lt;code&gt;user&lt;/code&gt; hides everything under it; hiding only &lt;code&gt;user.email&lt;/code&gt; keeps &lt;code&gt;user.name&lt;/code&gt;. In the table, column order is still the one from the &amp;quot;Properties&amp;quot; menu, which keeps managing it.&lt;/p&gt;
&lt;h2 id=&quot;your-own-components-follow-the-menu&quot;&gt;Your own components follow the menu&lt;/h2&gt;
&lt;p&gt;If your list uses a hand-written row component, it has no way of knowing on its own which fields are hidden. Two tools tell it. &lt;code&gt;&amp;lt;Field name=&amp;quot;…&amp;quot;&amp;gt;&lt;/code&gt; renders nothing while the field is hidden, and &lt;code&gt;useFieldVisible(&amp;quot;…&amp;quot;)&lt;/code&gt; returns a boolean when the layout depends on it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { Field, useFieldVisible } from &amp;quot;react-resource-view&amp;quot;
import type { RowComponentPropsInterface } from &amp;quot;react-resource-view&amp;quot;

function TaskCard({ row }: RowComponentPropsInterface&amp;lt;Task&amp;gt;) {
  const showsPrice = useFieldVisible(&amp;quot;price&amp;quot;)
  if (!row) return null
  return (
    &amp;lt;article className={showsPrice ? &amp;quot;grid grid-cols-2&amp;quot; : &amp;quot;&amp;quot;}&amp;gt;
      &amp;lt;Field name=&amp;quot;user.name&amp;quot;&amp;gt;{row.data.user.name}&amp;lt;/Field&amp;gt;
      &amp;lt;Field name=&amp;quot;price&amp;quot;&amp;gt;{row.data.price} €&amp;lt;/Field&amp;gt;
    &amp;lt;/article&amp;gt;
  )
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;useFieldVisibility()&lt;/code&gt; reads and updates the whole choice, if you want to build your own control instead of the menu.&lt;/p&gt;
&lt;h2 id=&quot;keeping-the-choice-in-your-api-instead-of-the-browser&quot;&gt;Keeping the choice in your API instead of the browser&lt;/h2&gt;
&lt;p&gt;By default, each reader&amp;#39;s choice is written to &lt;code&gt;localStorage&lt;/code&gt;, one entry per resource, with no error during server rendering. To make the preference follow a person from one machine to another, 2.2 adds a &lt;code&gt;fieldVisibility&lt;/code&gt; port to &lt;code&gt;configurePorts&lt;/code&gt;, built on the same idea as the saved views port: &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt;, which may be async, and an optional &lt;code&gt;subscribe&lt;/code&gt; to react to a change made elsewhere.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { configurePorts } from &amp;quot;react-resource-view&amp;quot;

configurePorts({
  fieldVisibility: {
    read: (resource) =&amp;gt;
      fetch(`/api/field-visibility/${resource}`).then((r) =&amp;gt; (r.ok ? r.json() : null)),
    write: (resource, state) =&amp;gt;
      // state: { hidden: string[], shown: string[] }, or null to fall back to the declaration
      fetch(`/api/field-visibility/${resource}`, {
        method: state ? &amp;quot;PUT&amp;quot; : &amp;quot;DELETE&amp;quot;,
        headers: { &amp;quot;Content-Type&amp;quot;: &amp;quot;application/json&amp;quot; },
        body: state ? JSON.stringify(state) : undefined,
      }).then(() =&amp;gt; undefined),
  },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The state is deliberately small: &lt;code&gt;hidden&lt;/code&gt; for what the reader has hidden, &lt;code&gt;shown&lt;/code&gt; for what they have shown among the fields hidden by default. As long as nothing is stored (&lt;code&gt;null&lt;/code&gt;), the declaration applies.&lt;/p&gt;
&lt;h3 id=&quot;what-happens-to-existing-setups&quot;&gt;What happens to existing setups&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Columns hidden in a table before 2.2 are carried over to the new storage the first time the list is opened: nobody suddenly gets all their columns back.&lt;/li&gt;
&lt;li&gt;Saved views and presets remember hidden fields in a &lt;code&gt;hiddenFields&lt;/code&gt; key. A view saved with the old &lt;code&gt;columns.hidden&lt;/code&gt; still applies it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;already-merged-not-yet-released&quot;&gt;Already merged, not yet released&lt;/h2&gt;
&lt;p&gt;Three changes are on the main branch, with their changesets, but are not in 2.2.0: don&amp;#39;t rely on them until the next release.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;layout.feed()&lt;/code&gt;&lt;/strong&gt; shows an activity log: records become dated events, grouped by day under &amp;quot;Today&amp;quot;, &amp;quot;Yesterday&amp;quot; and then the date, along a vertical timeline. Filters, search, saved views and pagination work as in the other layouts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;Cmd+K&lt;/code&gt; / &lt;code&gt;Ctrl+K&lt;/code&gt; command palette&lt;/strong&gt; of &lt;code&gt;AdminLayout&lt;/code&gt; will be on by default. &lt;code&gt;commandPalette: false&lt;/code&gt; turns it off for an application that already uses that shortcut.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The development checks&lt;/strong&gt; in &lt;code&gt;createViewResource&lt;/code&gt; and &lt;code&gt;layout.*&lt;/code&gt; will no longer run in a production build, instead of possibly leaving the application stuck on its error screen there.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;upgrading&quot;&gt;Upgrading&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;npm i react-resource-view@latest&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The menu is there the first time a list is opened. If you don&amp;#39;t want to offer it on a resource, &lt;code&gt;fields: { toggle: false }&lt;/code&gt; is all it takes.&lt;/p&gt;
&lt;p&gt;For a first project, follow the &lt;a href=&quot;/react-resource-view/docs/resource-view/quickstart/&quot;&gt;quickstart&lt;/a&gt;; installation comes down to &lt;code&gt;npm i react-resource-view&lt;/code&gt;, detailed in the &lt;a href=&quot;/react-resource-view/docs/resource-view/installation/&quot;&gt;installation guide&lt;/a&gt;. The layouts mentioned here are described in the &lt;a href=&quot;/react-resource-view/docs/resource-view/layouts/&quot;&gt;layouts documentation&lt;/a&gt;, and the full list of changes is in the &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view/blob/main/CHANGELOG.md&quot;&gt;changelog&lt;/a&gt;. The code is on &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view&quot;&gt;GitHub&lt;/a&gt;, under the MIT license.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A Hermez product&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>React Resource View 2.0: Cmd+K command palette, saved views, board and generation from OpenAPI</title>
    <id>https://hermez.dev/react-resource-view/blog/react-resource-view-2-0-whats-new/</id>
    <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/react-resource-view-2-0-whats-new/"/>
    <published>2026-11-19T00:00:00Z</published>
    <updated>2026-11-19T00:00:00Z</updated>
    <summary>What React Resource View 2.0 changes for your React and TypeScript admin panel: a command palette, saved views, a board with no columns to declare, pages without data, singleton resources and resources generated from OpenAPI.</summary>
    <category term="What's new"/>
    <category term="React"/>
    <category term="Admin panel"/>
    <category term="TypeScript"/>
    <content type="html">&lt;p&gt;React Resource View 2.0.0 is out on npm. It bundles everything added since 1.0 for building a React admin panel or CRUD in TypeScript from a single resource declaration, and it removes a few internal names from the index. Here is what it changes for you as a user, with before / after code wherever the API moves.&lt;/p&gt;
&lt;h2 id=&quot;the-only-breaking-change-a-smaller-index&quot;&gt;The only breaking change: a smaller index&lt;/h2&gt;
&lt;p&gt;The major version bump comes down to one thing. The &lt;code&gt;react-resource-view&lt;/code&gt; index no longer re-exports internal helpers and test utilities: &lt;code&gt;onResourceViewDefaultsChange&lt;/code&gt;, &lt;code&gt;getRegisteredOpenFrames&lt;/code&gt;, &lt;code&gt;BUILT_IN_OPEN&lt;/code&gt;, &lt;code&gt;resolveOpen&lt;/code&gt;, &lt;code&gt;adoptResources&lt;/code&gt;, &lt;code&gt;useInlineClaim&lt;/code&gt;, &lt;code&gt;writeOptimistically&lt;/code&gt;, &lt;code&gt;isOptimistic&lt;/code&gt;, &lt;code&gt;notifyWriteError&lt;/code&gt;, &lt;code&gt;joinPath&lt;/code&gt;, &lt;code&gt;appendBracketParam&lt;/code&gt;, &lt;code&gt;flattenStrapiRecord&lt;/code&gt;, &lt;code&gt;PermissionCacheContext&lt;/code&gt;, &lt;code&gt;resetApiConfig&lt;/code&gt;, as well as the list view&amp;#39;s &lt;code&gt;Header&lt;/code&gt; and &lt;code&gt;ContentList&lt;/code&gt; components (whose names clashed with the router&amp;#39;s).&lt;/p&gt;
&lt;p&gt;If you only import &lt;code&gt;createViewResource&lt;/code&gt;, &lt;code&gt;layout&lt;/code&gt;, &lt;code&gt;createScope&lt;/code&gt; and their documented neighbours, there is nothing to do. Declarations marked &lt;code&gt;@internal&lt;/code&gt; are also gone from the published &lt;code&gt;.d.ts&lt;/code&gt; files, and a test now pins the list of public exports: any future addition or removal will show up in review.&lt;/p&gt;
&lt;h2 id=&quot;a-cmd-k-command-palette&quot;&gt;A Cmd+K command palette&lt;/h2&gt;
&lt;p&gt;With &lt;code&gt;commandPalette&lt;/code&gt; on &lt;code&gt;AdminLayout&lt;/code&gt; or &lt;code&gt;createAdminLayout&lt;/code&gt;, &lt;code&gt;Cmd+K&lt;/code&gt; (or &lt;code&gt;Ctrl+K&lt;/code&gt;) opens a palette built from the scope: go to a menu entry, start creating a record. It only lists what your resources&amp;#39; permissions allow.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;decoratorComponent: createAdminLayout({
  commandPalette: { searchable: true },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With &lt;code&gt;searchable: true&lt;/code&gt;, the palette also searches records, using each resource&amp;#39;s &lt;code&gt;titleField&lt;/code&gt;, sent as a list filter. The palette is a &lt;code&gt;dialog&lt;/code&gt; containing a &lt;code&gt;combobox&lt;/code&gt; and a &lt;code&gt;listbox&lt;/code&gt;; &lt;code&gt;Esc&lt;/code&gt; closes it. Before, an admin offered no keyboard navigation at all.&lt;/p&gt;
&lt;h2 id=&quot;saved-views-like-in-notion&quot;&gt;Saved views, like in Notion&lt;/h2&gt;
&lt;p&gt;A combination of filters, sorting, layout and columns that you can neither name nor share with a link is a gap. &lt;code&gt;views.list.savedViews: true&lt;/code&gt; adds saved view tabs above the list: users create, rename, duplicate and delete them.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;views: {
  list: {
    savedViews: true,
    presets: [
      { id: &amp;quot;mine&amp;quot;, name: &amp;quot;To do&amp;quot;, filter: { status: &amp;quot;todo&amp;quot; } },
    ],
  },
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every view has an address: &lt;code&gt;?savedView=&amp;lt;id&amp;gt;&lt;/code&gt; applies it. Views saved by a user go to &lt;code&gt;localStorage&lt;/code&gt; by default; the &lt;code&gt;savedViews&lt;/code&gt; port of &lt;code&gt;configurePorts&lt;/code&gt; accepts four functions (&lt;code&gt;list&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, &lt;code&gt;remove&lt;/code&gt;) to share them through your API. In development, a preset with no name, with an undeclared layout or with another preset&amp;#39;s id is rejected.&lt;/p&gt;
&lt;h2 id=&quot;a-board-that-reads-its-columns-from-the-form&quot;&gt;A board that reads its columns from the form&lt;/h2&gt;
&lt;p&gt;Before, a board required &lt;code&gt;columns&lt;/code&gt; next to the &lt;code&gt;options&lt;/code&gt; the form already declared for the same field. Now one column per option is enough:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// before
layout.board({
  groupBy: &amp;quot;status&amp;quot;,
  columns: [
    { value: &amp;quot;todo&amp;quot;, label: &amp;quot;To do&amp;quot; },
    { value: &amp;quot;done&amp;quot;, label: &amp;quot;Done&amp;quot; },
  ],
})

// after: one column per option of the `status` field
layout.board({ groupBy: &amp;quot;status&amp;quot; })&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;columns&lt;/code&gt; is still available to reorder columns or show only some of them, and now also accepts a function re-read on every render. &lt;code&gt;hideEmpty&lt;/code&gt; hides columns with no cards, except while a card is being dragged. Records whose value matches no column land in a &amp;quot;No value&amp;quot; column instead of disappearing. A resource can also allow moving cards without offering the edit form: &lt;code&gt;permissions: { update: false, move: true }&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;new-layouts-and-grouping&quot;&gt;New layouts and grouping&lt;/h2&gt;
&lt;p&gt;The list gains &lt;code&gt;layout.gallery({ imageField })&lt;/code&gt;, a grid of image cards for products, articles or profiles, as well as &lt;code&gt;layout.tree()&lt;/code&gt;, &lt;code&gt;layout.map()&lt;/code&gt; and &lt;code&gt;layout.chart()&lt;/code&gt;. &lt;code&gt;layout.table({ groupBy })&lt;/code&gt; and &lt;code&gt;layout.cards({ groupBy })&lt;/code&gt; split rows by field into collapsible sections with their count. Everything stays independent of the API: users switch between them from the list&amp;#39;s layout picker.&lt;/p&gt;
&lt;h2 id=&quot;pages-without-data-and-singleton-resources&quot;&gt;Pages without data and singleton resources&lt;/h2&gt;
&lt;p&gt;A home page, a help page or a dashboard doesn&amp;#39;t need a resource with every permission turned off and a fake &lt;code&gt;getCollection&lt;/code&gt;. &lt;code&gt;createPage&lt;/code&gt; declares a menu entry and a route to a component, with no API call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { createPage } from &amp;quot;react-resource-view&amp;quot;
import { LifeBuoy } from &amp;quot;lucide-react&amp;quot;

export const help = createPage(&amp;quot;help&amp;quot;, {
  name: &amp;quot;Help&amp;quot;,
  icon: LifeBuoy,
  component: HelpPage,
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For settings or a profile that has a single record, &lt;code&gt;singleton: { get }&lt;/code&gt; or &lt;code&gt;singleton: { id }&lt;/code&gt; opens the edit form straight from the menu, and shows the create form, prefilled with &lt;code&gt;defaultData&lt;/code&gt;, when the record doesn&amp;#39;t exist yet.&lt;/p&gt;
&lt;h2 id=&quot;generate-resources-from-openapi&quot;&gt;Generate resources from OpenAPI&lt;/h2&gt;
&lt;p&gt;After &lt;code&gt;init&lt;/code&gt;, you still had to write every &lt;code&gt;createViewResource&lt;/code&gt; by hand. The following command reads an OpenAPI 3.0 / 3.1 or Swagger 2.0 schema (API Platform, FastAPI, Supabase…) from a file or a URL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx react-resource-view generate resources
npx react-resource-view generate resources --only books,authors --dry-run&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It writes one declaration per collection, with the &lt;code&gt;path&lt;/code&gt;, the &lt;code&gt;form.inputs&lt;/code&gt; (enums as select lists, IRIs and foreign keys as searchable relations, dates, numbers, booleans), the &lt;code&gt;permissions&lt;/code&gt; matching the exposed operations and a table, plus a board if an enum field is named &lt;code&gt;status&lt;/code&gt;. The resources are added to the scope&amp;#39;s &lt;code&gt;resources&lt;/code&gt;; no existing file is overwritten without &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;plugging-in-a-plain-rest-api&quot;&gt;Plugging in a plain REST API&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;restDialect&lt;/code&gt; describes a typical REST API through configuration (&lt;code&gt;X-Total-Count&lt;/code&gt;, &lt;code&gt;Link&lt;/code&gt; header, cursor pagination), with the &lt;code&gt;jsonServerDialect&lt;/code&gt; and &lt;code&gt;drfCursorDialect&lt;/code&gt; presets, and &lt;code&gt;init -b json-server&lt;/code&gt; to get started. A hand-written repository now returns &lt;code&gt;{ items, totalItems }&lt;/code&gt; and always receives &lt;code&gt;{ id: string }&lt;/code&gt;. If yours read the &lt;code&gt;@id&lt;/code&gt; of the object it received, it must read &lt;code&gt;id&lt;/code&gt; instead. The new &lt;code&gt;idField&lt;/code&gt; option says where links and keys come from: your records no longer need an &lt;code&gt;@id&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;also-new&quot;&gt;Also new&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;the &lt;code&gt;createMediaImageInput&lt;/code&gt; and &lt;code&gt;createMediaFilesInput&lt;/code&gt; controls keep an image or documents as base64 in the record, with no upload API;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;react-resource-view/i18n&lt;/code&gt; exports &lt;code&gt;messages&lt;/code&gt; and &lt;code&gt;missingKeys(dictionary)&lt;/code&gt;, so a test can fail when a release adds a message your dictionary doesn&amp;#39;t translate;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;inspectDefinition&lt;/code&gt; lists the problems in a declaration without throwing, handy in CI;&lt;/li&gt;
&lt;li&gt;empty lists tell &amp;quot;nothing yet&amp;quot; apart from &amp;quot;nothing matches&amp;quot;, and real-time updates batch a burst of notifications into a single fetch;&lt;/li&gt;
&lt;li&gt;several fixes: the JSON-LD dialect reads &lt;code&gt;hydra:violations&lt;/code&gt;, &lt;code&gt;ApiUri&lt;/code&gt; no longer waits forever after an error, and the calendar can be driven from the keyboard.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;upgrading&quot;&gt;Upgrading&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;npm i react-resource-view@latest&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The full list is in the &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view/blob/main/CHANGELOG.md&quot;&gt;changelog&lt;/a&gt;. For a first project, follow the &lt;a href=&quot;/react-resource-view/docs/resource-view/quickstart/&quot;&gt;quickstart&lt;/a&gt;; to go further, the &lt;a href=&quot;/react-resource-view/docs/resource-view/quickstart/&quot;&gt;documentation&lt;/a&gt; covers every option mentioned here. The code is on &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view&quot;&gt;GitHub&lt;/a&gt;, under the MIT license.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A Hermez product&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>React Resource View 2.1: virtualized tables and dialogs that open without freezing the page</title>
    <id>https://hermez.dev/react-resource-view/blog/react-resource-view-2-1-virtualized-tables/</id>
    <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/react-resource-view-2-1-virtualized-tables/"/>
    <published>2026-11-19T00:00:00Z</published>
    <updated>2026-11-19T00:00:00Z</updated>
    <summary>React Resource View 2.1 (with react-data-form 0.5.0) only mounts the visible rows of a table past 200 rows, and drops the CSS selectors that made the browser restyle the whole page every time a dialog opened. Measured numbers and how to use it.</summary>
    <category term="What's new"/>
    <category term="React"/>
    <category term="Performance"/>
    <category term="TypeScript"/>
    <content type="html">&lt;p&gt;React Resource View 2.1.0 is out on npm. It changes nothing about how you declare a resource: it speeds up two things you notice as soon as your data grows, a table with several thousand rows and opening a dialog on a large page. No migration is needed.&lt;/p&gt;
&lt;h2 id=&quot;a-table-that-only-renders-what-is-on-screen&quot;&gt;A table that only renders what is on screen&lt;/h2&gt;
&lt;p&gt;Until now, &lt;code&gt;layout.table()&lt;/code&gt; mounted one DOM row per record on the page. With a few hundred rows you couldn&amp;#39;t tell; with a few thousand, opening the list, scrolling and every state change paid the price.&lt;/p&gt;
&lt;p&gt;In 2.1, past 200 rows, the table only renders the visible rows, plus a few on either side of the viewport. The rest is replaced by two spacer rows sized to the measured height of the missing rows, so the scrollbar keeps its size and position.&lt;/p&gt;
&lt;p&gt;Measured on a page of 2,000 rows, in jsdom (the browser simulator used by the tests, not a real browser):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Mounted DOM nodes&lt;/td&gt;
&lt;td&gt;64,044&lt;/td&gt;
&lt;td&gt;782&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mount time&lt;/td&gt;
&lt;td&gt;about 14.7 s&lt;/td&gt;
&lt;td&gt;about 0.2 to 0.35 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;These numbers come from a test, not from a browser profile: they tell you how much work goes away, not exactly how much time you will save on your machine.&lt;/p&gt;
&lt;h3 id=&quot;what-stays-the-same&quot;&gt;What stays the same&lt;/h3&gt;
&lt;p&gt;The table is still a real &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;: the header and pinned cells stay put, and column widths are kept while scrolling. Groups (collapsed or not) and views expanded under a row are virtualized as a single flat list.&lt;/p&gt;
&lt;p&gt;Anything that touches data doesn&amp;#39;t depend on what is rendered: &amp;quot;Select all&amp;quot; and bulk actions apply to every record on the page, visible or not. On the keyboard, &lt;code&gt;↑&lt;/code&gt; / &lt;code&gt;↓&lt;/code&gt; and &lt;code&gt;Ctrl+Home&lt;/code&gt; / &lt;code&gt;Ctrl+End&lt;/code&gt; move between rows and scroll to them. The table carries &lt;code&gt;aria-rowcount&lt;/code&gt; and each row &lt;code&gt;aria-rowindex&lt;/code&gt;, so screen readers announce the right position in the full list.&lt;/p&gt;
&lt;h2 id=&quot;how-to-turn-it-on&quot;&gt;How to turn it on&lt;/h2&gt;
&lt;p&gt;There is nothing to do: virtualization is on by default past 200 rows. To tune it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;layout.table({ virtualize: false }) // all rows, always
layout.table({ virtualize: true }) // only the ones on screen, always
layout.table({ virtualize: { threshold: 500, overscan: 4 } })&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;threshold&lt;/code&gt; is the number of rows from which virtualization kicks in, and &lt;code&gt;overscan&lt;/code&gt; the number of rows rendered beyond each edge of the viewport (8 by default). The update adds one dependency, &lt;code&gt;@tanstack/react-virtual&lt;/code&gt;, installed with the package.&lt;/p&gt;
&lt;h2 id=&quot;dialogs-that-no-longer-make-the-browser-restyle-everything&quot;&gt;Dialogs that no longer make the browser restyle everything&lt;/h2&gt;
&lt;p&gt;The second change is a performance fix. Some components (field, checkbox, list item, confirmation dialog, button group) produced CSS selectors with a &lt;code&gt;:has()&lt;/code&gt; placed before the styled element, or a &lt;code&gt;~&lt;/code&gt; between two arbitrary elements. On a page with tens of thousands of nodes, Chrome then had to recalculate styles for the whole page: hundreds of milliseconds every time a dialog opened or closed.&lt;/p&gt;
&lt;p&gt;These rules are now written differently: a class as the subject, the &lt;code&gt;:has()&lt;/code&gt; on the styled element itself, or &lt;code&gt;:nth-child(n + 2 of [data-slot])&lt;/code&gt;. The components look the same, with the same specificity or higher. A test builds the stylesheet with Tailwind&amp;#39;s scanner and fails if any of these patterns comes back.&lt;/p&gt;
&lt;p&gt;If your app scans &lt;code&gt;react-resource-view/dist&lt;/code&gt; with &lt;code&gt;@source&lt;/code&gt; and worked around the problem with &lt;code&gt;@source not inline(…)&lt;/code&gt;, you can remove that workaround.&lt;/p&gt;
&lt;h2 id=&quot;on-the-react-data-form-0-5-0-side&quot;&gt;On the react-data-form 0.5.0 side&lt;/h2&gt;
&lt;p&gt;React Resource View&amp;#39;s forms come from &lt;code&gt;react-data-form&lt;/code&gt;, which ships its 0.5.0 release the same day. It applies the same performance fix to its own components (&lt;code&gt;Checkbox&lt;/code&gt;, &lt;code&gt;Field&lt;/code&gt;, &lt;code&gt;FieldDescription&lt;/code&gt;, &lt;code&gt;ItemMedia&lt;/code&gt;): no more &lt;code&gt;:has()&lt;/code&gt; placed before the styled element, so form dialogs open faster on large pages, with unchanged rendering.&lt;/p&gt;
&lt;p&gt;It also brings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a stylesheet aligned with the Brand Assets design system: &lt;code&gt;--heading-weight&lt;/code&gt; goes to 600, &lt;code&gt;--heading-tracking&lt;/code&gt; to &lt;code&gt;-0.02em&lt;/code&gt;, the &lt;code&gt;--shadow-glow&lt;/code&gt; token is removed, and fields use named transitions instead of &lt;code&gt;transition-all&lt;/code&gt;. If your theme relied on &lt;code&gt;--shadow-glow&lt;/code&gt;, replace it;&lt;/li&gt;
&lt;li&gt;a fix to &lt;code&gt;FormArrayInputController&lt;/code&gt;: editing a block now only edits that block, instead of overwriting another one when the stored order differs from the array order.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;upgrading&quot;&gt;Upgrading&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;npm i react-resource-view@latest react-data-form@latest&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The full list is in the &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view/blob/main/CHANGELOG.md&quot;&gt;changelog&lt;/a&gt;. The &lt;code&gt;virtualize&lt;/code&gt; option is covered in the &lt;a href=&quot;/react-resource-view/docs/resource-view/layouts/&quot;&gt;layouts documentation&lt;/a&gt;, and the code is on &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view&quot;&gt;GitHub&lt;/a&gt;, under the MIT license.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A Hermez product&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A complete React admin panel from your resources: React Resource View in 10 minutes</title>
    <id>https://hermez.dev/react-resource-view/blog/a-complete-react-admin-in-10-minutes/</id>
    <link rel="alternate" type="text/html" href="https://hermez.dev/react-resource-view/blog/a-complete-react-admin-in-10-minutes/"/>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <summary>Declare a resource once and get the list, detail page, create, edit and delete screens for your REST API, with a filter and several ways to display the same rows.</summary>
    <category term="Tutorial"/>
    <category term="React"/>
    <category term="Admin panel"/>
    <content type="html">&lt;p&gt;An admin panel is always the same story: a table, a form to create, the same form to edit, a delete button, a few filters. You write it for the first resource, then copy it for the second, the third, the tenth.&lt;/p&gt;
&lt;p&gt;React Resource View tackles the problem from the other end: &lt;strong&gt;you declare the resource once&lt;/strong&gt;, and the library builds the five CRUD screens from that declaration. Here is how, in ten minutes, against an existing REST API.&lt;/p&gt;
&lt;h2 id=&quot;what-were-building&quot;&gt;What we&amp;#39;re building&lt;/h2&gt;
&lt;p&gt;A React application that talks to an API and offers, for an &lt;code&gt;articles&lt;/code&gt; resource:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a paginated &lt;strong&gt;list&lt;/strong&gt;, with a filter;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;detail page&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;create&lt;/strong&gt; form and an &lt;strong&gt;edit&lt;/strong&gt; form;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;delete&lt;/strong&gt; action with confirmation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The list renders as a table or as cards, and users switch between them on the fly, like in a Notion database.&lt;/p&gt;
&lt;h2 id=&quot;1-a-project-wired-to-your-api&quot;&gt;1. A project wired to your API&lt;/h2&gt;
&lt;p&gt;The quickest route is to let the starter write the application around your API:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx react-resource-view init my-admin
cd my-admin
npm install
npm run dev&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The command asks which API you&amp;#39;re talking to (API Platform, Spring Boot, Supabase, Strapi, FastAPI, Django or any REST API) and where it runs. You get an admin panel on &lt;code&gt;http://localhost:5173&lt;/code&gt;, with its menu and a sample resource.&lt;/p&gt;
&lt;p&gt;If you already have an application, just add the package:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm add react-resource-view react-data-form react-mini-i18n resource-registry&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then configure API access, once, before the first render:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { configureApi, configurePorts } from &amp;quot;react-resource-view&amp;quot;
import { tanstackAdapter } from &amp;quot;react-resource-view/tanstack&amp;quot;

configurePorts({ navigation: tanstackAdapter })
configureApi({
  baseUrl: &amp;quot;https://api.example.com&amp;quot;,
  getAuthToken: () =&amp;gt; localStorage.getItem(&amp;quot;token&amp;quot;) ?? undefined,
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By default, the library speaks JSON-LD and Hydra, the API Platform format. For a different API, you switch &lt;em&gt;dialect&lt;/em&gt; without touching the resource declaration.&lt;/p&gt;
&lt;h2 id=&quot;2-declare-the-resource&quot;&gt;2. Declare the resource&lt;/h2&gt;
&lt;p&gt;A declaration says where the resource lives on the API and which fields it has. Those fields are both the create and edit form &lt;strong&gt;and&lt;/strong&gt; the table columns:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { createViewResource } from &amp;quot;react-resource-view&amp;quot;

export const articles = createViewResource(&amp;quot;articles&amp;quot;, {
  name: &amp;quot;Articles&amp;quot;,
  path: &amp;quot;/api/articles&amp;quot;,
  form: {
    inputs: {
      title: { label: &amp;quot;Title&amp;quot;, required: true },
      author: { label: &amp;quot;Author&amp;quot; },
    },
  },
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The name is used to derive page titles (&amp;quot;Articles&amp;quot;, &amp;quot;Edit — Articles&amp;quot;…). Everything is allowed by default; a &lt;code&gt;permissions&lt;/code&gt; key restricts whatever needs restricting.&lt;/p&gt;
&lt;h2 id=&quot;3-render-the-list&quot;&gt;3. Render the list&lt;/h2&gt;
&lt;p&gt;All that&amp;#39;s left is to render the resource:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { ActionList } from &amp;quot;react-data-form&amp;quot;
import { ViewResourceContextProvider } from &amp;quot;react-resource-view&amp;quot;

export function ArticlesPage() {
  return (
    &amp;lt;ViewResourceContextProvider
      resource={articles}
      resourceAction={ActionList.list}
    /&amp;gt;
  )
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You see a table with one row per record returned by the API, pagination, a create button, and edit and delete actions on each row. All five screens come from the same declaration.&lt;/p&gt;
&lt;h2 id=&quot;4-add-a-filter&quot;&gt;4. Add a filter&lt;/h2&gt;
&lt;p&gt;The filter bar is an ordinary form, declared in &lt;code&gt;views.list.filters&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;views: {
  list: {
    filters: {
      inputs: {
        title: { label: &amp;quot;Search a title&amp;quot; },
      },
    },
  },
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The filter is written to the URL: a copied link reproduces the same list, and the browser&amp;#39;s back button does what you expect.&lt;/p&gt;
&lt;h2 id=&quot;5-a-second-display&quot;&gt;5. A second display&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Layouts&lt;/em&gt; decide how the same rows are drawn. Add cards next to the table:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import { layout } from &amp;quot;react-resource-view&amp;quot;

views: {
  list: {
    layouts: [layout.table(), layout.cards({ columns: 3 })],
  },
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A switcher appears above the list. Changing the display reloads nothing and costs no extra code: the table, the cards, but also a column board, a calendar or a timeline are all declared the same way.&lt;/p&gt;
&lt;h2 id=&quot;going-further&quot;&gt;Going further&lt;/h2&gt;
&lt;p&gt;In ten minutes, you have an application that lists, filters, creates, edits and deletes, with two displays. The rest is in the &lt;a href=&quot;/react-resource-view/docs/resource-view/quickstart/&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/react-resource-view/docs/resource-view/backends/&quot;&gt;backends and dialects&lt;/a&gt; to talk to Strapi, Supabase or any REST API;&lt;/li&gt;
&lt;li&gt;permissions, to say who can do what;&lt;/li&gt;
&lt;li&gt;layouts, to choose between table, cards, board, calendar and the others.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code is on &lt;a href=&quot;https://github.com/hermez-agency/react-resource-view&quot;&gt;GitHub&lt;/a&gt;, under the MIT license.&lt;/p&gt;
</content>
  </entry>
</feed>
