# useCreateSubname

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Creates a subname, optionally with records. Signature, options, result and examples for useCreateSubname in @ensforge/react.

Source: https://ensforge.com/docs/reference/react/use-create-subname

<ApiMeta kind="Write hook" stability="stable" since="1.0.0" source="packages/react/src/hooks/named/writes.ts#L184" />

Creates a subname, optionally with records. Preset of `useWrite(Actions.subname.create)`.

It wraps [`subname.create`](/docs/reference/sdk/subname/create): the same options, result and errors.

## Signature [#signature]

```ts
function useCreateSubname(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.subname.create>[1], Actions.subname.create.ReturnType, Actions.subname.create.ErrorType >
```

## Examples [#examples]

```tsx title="A button that sends it"
import { useCreateSubname } from "@ensforge/react"

function Send() {
  const { mutate, isPending } = useCreateSubname()
  return <button disabled={isPending} onClick={() => mutate({ name: "pay.alice.eth", owner: recipient })}>Send</button>
}
```

## See also [#see-also]

- The [hook types](/docs/reference/react#types): `ReadResult`, `WriteResult` and `ReadConfig`.