---
url: "https://vueda.dev/v3/reference/api/js/use/useDetailView/functions/useDetailView.md"
title: "useDetailView"
---

# useDetailView

## Overview

Extracts all reactive state and wiring for a detail view of a single model instance.
The caller owns the template; this composable owns object fetching, action availability,
error combination, and populating `formInitialValue` from the fetched object.

Pass the component's `props` directly as `options` — the composable reads what it needs
via reactive property access. `formInitialValue` must be a reactive object (or a ref to
one); the composable watches the fetch and assigns the object data into it automatically.

Theme, slot name resolution, `useSlots`, `defineEmits`, and `onMounted` event emission
are all caller responsibilities and are not handled by this composable.

## Signature

`useDetailView(options, formInitialValue)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-options">options</span> | [DetailViewOptions](/v3/reference/api/js/use/useDetailView/types/DetailViewOptions.md) | yes |  |
| <span id="param-formInitialValue">formInitialValue</span> | `any` | yes | Reactive target populated with the fetched object data on each successful load. |

### Returns

[DetailViewContext](/v3/reference/api/js/use/useDetailView/types/DetailViewContext.md)

## Source

`client/lib/use/useDetailView.js:156`
