Skip to content

Commit

Permalink
docs(FormSet): refactor jsx examples to tsx (#2208)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed May 31, 2023
1 parent 3f32856 commit 170702f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,12 @@ export const FormSetSubmit = () => (
</FormSet>
</ComponentBox>
)

export const FormSetInfoVertical = () => (
<ComponentBox hidePreview hideToolbar>
<FormSet direction="vertical">
<FormRow>Components are now vertical aligned</FormRow>
<FormRow>Components are now vertical aligned</FormRow>
</FormSet>
</ComponentBox>
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
showTabs: true
---

import { FormSetInfoVertical } from 'Docs/uilib/components/form-set/Examples'

## Description

The FormSet component gives you both a HTML form element `<form>` by default and also a React provider for [FormRow](/uilib/components/form-row). This way you can define more globally e.g. if all the rows should be displayed **vertically**.

```jsx
<FormSet direction="vertical">
<FormRow>/** Components are now vertical aligned */</FormRow>
<FormRow>/** Components are now vertical aligned */</FormRow>
</FormSet>
```
<FormSetInfoVertical />

0 comments on commit 170702f

Please sign in to comment.