Admin UI
Everything on screen comes from the loaded spec. This page lists the pieces you compose with, and the three ways to override the generated behaviour.
๐ฆ Components
| Export | Purpose |
|---|---|
AppProvider |
Loads and validates the spec, builds resource configs, initialises the axios client, provides context. Wrap the app with it. |
Admin |
Sidebar + nested routes for every resource. Takes basePath. |
ProfileRoutes |
Routes for x-profile view/edit/create operations. |
ListCellRenderer |
One list/table cell; honours FK display formats, inline refs, enums, booleans. |
DetailFieldRenderer |
Read-only label + value pair in the detail view. |
FormFieldRenderer |
Editable form field; dispatches to the concrete control. |
FilterBar / SideMenu / Layout |
Layout primitives used by Admin. |
ValidationAlert |
Spec validation errors/warnings surface. |
SseStreamView |
Live stream card: status, event counter, latest event, snackbar. |
SseConnectionStatus |
Green/red dot with Connected/Disconnected โ reactive everywhere. |
MultiEnumField, CurrencyField, FkMultiSelectField |
Exported controls you can reuse in custom screens. |
Field renderer dispatch
| Condition | Form control | List / detail |
|---|---|---|
x-fk, not an array |
FkSelectField |
display-format cell |
x-fk, type: array |
FkMultiSelectField |
chips |
enum |
EnumField |
chip |
type: boolean |
BooleanField (switch) |
Yes/No chip |
type: integer / number |
NumberField |
typography |
format: date / date-time |
DateField |
typography |
x-ui-type: image / x-upload |
upload control | avatar / chip |
$ref without x-fk |
disabled JSON field | InlineRefField chips |
| otherwise | StringField |
typography |
๐ฆ Hooks
useAppContext()โ the whole derived model.useResource(name)โ CRUD + optionalstream(handlers, pathParams?) โ { close }forx-sseresources;componentsholds the per-resource filter widgets.useItemSse(url, handlers)โ subscribe to one item's event stream.useFkFieldOptions(...)/getApi()โ FK options and the configured axios instance for custom calls.sanitizePayload(payload, resolver)โ strips/normalises fields before create/update.
๐ฆ Three ways to customise
1. Per-resource behaviour โ specConfiguration.resourceConfig
2. Profile screens โ specConfiguration.profileComponents
3. Your own screens โ hooks
๐ก Streaming
useResource("calls").stream({ onEvent, onError, onOpen }) returns a
subscription with close(). Reconnection is browser-native; components read
connection state from SseConnectionStatus.
๐ Auth
getToken is called per request and injected as Authorization: Bearer.
Auth endpoints are derived from the spec's securitySchemes.bearerAuth
extensions (see Spec Extensions).
Combine with react-auth
react-auth owns the login/register UI and the session;
react-openapi only needs a token. Feed getToken: tokenStore.get into
specConfiguration to share one session between the two.