Skip to content

Commit

Permalink
docs: improved docs for FieldGroup component
Browse files Browse the repository at this point in the history
  • Loading branch information
zaalbarxx committed Nov 21, 2023
1 parent 2dfeab7 commit a9f758f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docs/src/pages/api/field-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@ description: API reference for the Field Group component
menuTitle: '<FieldGroup />'
order: 5
---

import CodeTitle from '@/components/CodeTitle.vue';
import DocBadge from '@/components/DocBadge.vue';

# FieldGroup <DocBadge title="v4.5" />
# FieldGroup <DocBadge title="v4.7" />

The `<FieldGroup />` component is used to provide state of group of fields. It is a renderless component, meaning it doesn't render anything of its own.
It can be

```vue-html
<Form>
<FieldGroup v-slot="{ meta }">
<Field name="addressField" type="text" />
<Field name="addressField2" type="text" />
Is address group valid ? {{ meta.valid }}
</FieldGroup>
<button>Submit</button>
</Form>
```

It can be nested which means there can be `FieldGroup` inside `FieldGroup` (like on example):

```vue-html
<Form>
<FieldGroup v-slot="{ meta }">
Expand Down Expand Up @@ -45,4 +61,4 @@ This is a **read-only** property which gives access to aggregated state of field
### Ref
Ref gives access to the same `meta: FieldGroupMeta` value as slot.
Ref gives access to the same `meta: FieldGroupMeta` value as slot.

0 comments on commit a9f758f

Please sign in to comment.