Skip to content

DetailView

Overview

Renders a full detail page for a single model instance, including a page title, a sticky action bar with available object actions and workflow transitions, and a FormModel that displays or edits the object's fields. Fetches the object from the API automatically using the provided app, model, and pk props.

Theme entry: DetailView

Props

NameTypeRequiredDefaultDescription
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
appstringyesDjango app label that owns the model.
modelstringyesDjango model name identifying which object type to fetch and display.
viewNamestringyesView identifier used to load the model config and construct the form ID.
pkstringyesPrimary key of the object instance to fetch and render.
objectFormobjectundefinedForm state object returned by useObjectForm, used to track submission state and trigger submit.
variantstring"default"Theme variant applied to the root element.
formModelVariantstring"default"Theme variant forwarded to the inner FormModel component.
classstring|array|object() => []CSS class(es) applied to the outermost root element.
fieldsarrayundefinedField names to render in the form; overrides the model config default.
fieldDetailsobjectundefinedMap of field paths to field detail overrides.
expandarrayundefinedField names to render in expanded (inline) mode.
expandDetailsobjectundefinedMap of expand field paths to detail overrides.
fieldComponentsobjectundefinedMap of field paths to async functions returning an override field component.
widgetComponentsobjectundefinedMap of field paths to async functions returning an override widget component.
formPropsobjectundefinedExtra props merged into the FormModel component.
fieldPropsobjectundefinedMap of field paths to additional props passed to the field component.
widgetPropsobjectundefinedMap of field paths to additional props passed to the widget component.
relatedObjectRulesobject{}Rules mapping related object keys to fetch data alongside the main object.
calculatedObjectRulesobject{}Rules mapping calculated object keys to derive computed data alongside the main object.
fetchFieldsarrayundefinedField names to request from the API when fetching the object; overrides the model config default.
submitFieldsarrayundefinedField names to include when submitting the form; overrides the model config default.
primaryActionsarrayundefinedAction names promoted to the filled hero CTA in the action bar; defaults to the update action.

Slots

NameScopedDescription
targetless-action-buttonyes
extra-buttonsAdditional action buttons appended in the page title action area.
submit-buttonyesOverride the submit button shown in the sticky action bar for update views.
action-buttonyesOverride an individual action link button in the sticky bar.
transition-buttonyesOverride an individual workflow transition button in the sticky bar.

Full slot reference

Events

NameDescription
object
loading
related-object
calculated-object
form-object
form-context

Full event reference

Source

client/lib/views/DetailView.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2