Skip to main content

ShowShell

A read-only detail screen: the React Admin <Show> controller, the record contexts the fields need, and the ViewContent frame around them.

Field components read their record from context. Rendering one on a custom page without this wrapper gives you an empty field, not an error — which is the usual reason a hand-built detail screen comes up blank.

Example​

import {ShowShell, PropertyShowLayout, TextField, NumberField} from 'habarico';

<ShowShell
title="Order detail"
controllerProps={{resource: 'eshop/order', id: orderId}}
toolbarActions={<EditButton />}
>
<PropertyShowLayout>
<TextField source="number" />
<NumberField source="total" />
</PropertyShowLayout>
</ShowShell>

Props​

NameTypeDefaultDescription
childrenReactNode—The fields
recordRaRecordrecord from the controllerRenders a record you already have instead of fetching one
controllerPropsOmit<ShowProps, 'children'>—Plain React Admin <Show> props — id, resource, queryOptions, …
titleReactNode—Portaled to the layout header
subtitleReactNode—Rendered under the title
breadcrumbsReactNode—Injected into the layout's breadcrumb slot
toolbarActionsReactNode—Portaled next to the title
bottomActionsReactNode—Bottom action bar; becomes DialogActions in a dialog

The shell turns the <Show> card off (component="div") — the visible surface comes from the Panels inside, not from the shell. It also waits out React Admin's loading skeleton and re-provides the loaded record as both RecordContext and RootRecordContext, so nested boxes resolve relative sources against the right record.

tip

A read-only edit view is not a variant of the form shells — the schema layer renders ShowShell instead. EditShell and CreateShell therefore carry no readOnly prop.

See also​