Skip to main content
Clicking a row in the list, a card on a board, an event on a calendar or a record link in a custom view opens the record in a panel beside the view. The panel is the edit page’s own form, so every field type, hook, validation rule and access rule works as it does on the edit page. Clicking another record switches the panel to it. The panel is on for every collection. Set admin.panel: false to open records on their edit page instead.

Layout

From the top, the panel shows:
  1. The header, one bar pinned to the top, the same bar every side panel uses. On the right, always in this order: a status slot, a ••• menu, open full page and close (✕). The status slot shows one thing: Unsaved and Save while a collection without autosave has unsaved edits (and Save on a new record), otherwise Mark complete for collections with useAsDone, which saves at once and reads Completed in green, otherwise Saved for drafts autosave. Below 480 px wide, Mark complete shrinks to a check icon. The menu holds copy link, duplicate, create new, your actions, the last saved time and delete in red. On the left the header never repeats what you can see: nothing at rest, since the view behind the panel already names the collection (also after a reload or a shared link), and a back link (‹ Budget feature) when the record was opened from inside the panel. The title joins it once the body’s title scrolls under the header. At narrow widths the back link and title truncate; the buttons never wrap.
  2. The useAsTitle field as a large heading you edit in place, wrapping onto more lines rather than cutting off. It needs a text, textarea or email field. Without one, the header always shows the title.
  3. Your beforeFields components.
  4. The properties fields as label and value rows.
  5. Every other field, in config order. No field appears twice.
  6. Your afterFields components.
  7. Your footer components, pinned under the scrolling body.
The menu hides what the user can’t do. Delete asks first, and moves the record to the trash when the collection has trash. A replaced Header keeps the title in the body. Esc closes the panel unless a menu, picker or dialog inside it is open.

Settings

Settings go in admin.panel, React components in admin.components.panel, the same split as the edit view.

Components

Every slot gets PanelComponentProps:
Server components also get the edit view’s server props: payload, req, permissions and doc. Functions can’t cross from the server, so a server component’s client children read close and expand from useRecordPanel():
Every slot except Component renders inside the edit form, so it can use the form hooks such as useField and useDocumentInfo. The footer is portalled below the form’s element, so a <form> of its own, such as a comment box, doesn’t nest inside the edit form, and Enter in it doesn’t save the record.

Building blocks

@frogbotai/ui/admin exports the pieces the panel is made of, so your slots look like the built-in parts:
  • SidePanelMenuItem from @frogbotai/ui is an item in the header’s ••• menu. Render it from actions; onSelect runs when it’s chosen, and danger colours it red.
  • PanelIconButton is the panel’s 32 px icon button. Give it an icon at 16 px and a label, which is also its tooltip.
  • PanelSection is a titled block: a heading, an optional add button (onAdd, addLabel) and its content.
  • The fb-pill-tabs class on a tabs field gives it small pill tabs. The error count on a tab with invalid fields and the remembered tab per record work as before.

Opening a record from inside the panel

A component inside the panel that opens another record of the collection passes from: 'panel', so the header shows a back link to the record it came from:
The back link asks before throwing away unsaved edits, and skips records deleted meanwhile. The chain lives in memory only: opening a record from the view, closing, opening the full page or deleting clears it, and a reload or shared link starts without a back link. The browser’s Back button leaves the view, as before.

Activity and comments

Activity and comments are fields, so the full edit page shows them too. Put a tabs field at the end of fields, with commentsField() from the comments plugin in one tab and activityField() from the audit log plugin in another:
Either field also works alone, outside a tabs field. Posting a comment doesn’t change the record, so the panel doesn’t ask before closing.

Saving

The panel saves the way the edit page does: the Save button or Cmd/Ctrl-S, or autosave when the collection has versions.drafts.autosave, which hides Save. A save updates the record’s card, row or event; unsaved values never show on it. Switching records, closing, Esc and clicking outside ask before throwing away unsaved edits. Custom views hear about saves and deletes with useRecordPanelEvents:

Behavior

  • The open record is ?record=<id> on every view. Reload, Back and shared links reopen it. Opening or switching a record replaces the history entry, so Back doesn’t step through each record.
  • Cmd, Ctrl or Shift-click, or a middle click, opens the record’s edit page in a new tab.
  • Esc, the close button, or a click on the view outside a record closes the panel.
  • A record that is missing or the user can’t read closes the panel with a not-found message.
  • Below 768 px the panel covers the view.
  • With panel: false, ?record=<id> redirects to the record’s edit page, so shared links keep working.
  • Create, from a board column or a calendar slot, opens the create form in the panel; the first save switches it to the new record.