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

# useSubForm

## Overview

Creates a child form context that delegates submission and loading state to a parent form context, scoped to an optional path prefix.

## Signature

`useSubForm(options)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-options">options</span> | `object` | yes | Options for the subform. |

#### options Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-options-parentPath">parentPath</span> | `string \| Ref` |  |  | The path to the parent form. |

### Returns

[FormContext](/v3/reference/api/js/use/useForm/types/FormContext.md)

- The sub form context for the subform.

## Source

`client/lib/use/useSubForm.js:18`
