Skip to content

Commit 590fd08

Browse files
committed
Added SUIR mapper page to docs.
1 parent 26b5d56 commit 590fd08

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

packages/react-renderer-demo/src/components/navigation/mappers.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ export const mappers = [
1414
{
1515
component: 'blueprint-component-mapper',
1616
linkText: 'BlueprintJS'
17+
},
18+
{
19+
component: 'suir-component-mapper',
20+
linkText: 'Semantic UI'
1721
}
1822
];
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import Grid from '@material-ui/core/Grid'
2+
import ListOfContents from '@docs/list-of-contents';
3+
4+
<Grid container item>
5+
<Grid item xs={12} md={10}>
6+
7+
# Semantic UI react
8+
9+
Semantic UI react mapper provides components from [Semantic UI react](https://react.semantic-ui.com/).
10+
11+
## Installation
12+
13+
Link to [NPM](https://www.npmjs.com/package/@data-driven-forms/suir-component-mapper).
14+
15+
```bash
16+
npm install --save @data-driven-forms/suir-component-mapper
17+
```
18+
or
19+
```bash
20+
yarn add @data-driven-forms/suir-component-mapper
21+
```
22+
23+
Semantic UI react library is an external dependency and will not be installed with the mapper. Make sure that [Semantic UI react](https://react.semantic-ui.com/usage) is installed in your project.
24+
25+
## ValidateOnMount
26+
27+
Semantic UI react mapper provides an option to validate a field when the component is mounted. Just set `validateOnMount` to `true`.
28+
29+
```jsx
30+
{
31+
component: 'text-field',
32+
name: 'required-field',
33+
validate: [{type: 'required'}],
34+
validateOnMount: true
35+
}
36+
```
37+
38+
This field will show the error immediately.
39+
40+
## Components customization
41+
All components accept all other props described in Semantic UI react documentation. You can find prop names for each component in component definition section of this documentation when the SUIR mapper is selected. You can start by looking at [checkbox example](/component-example/checkbox?mapper=suir).
42+
43+
To avoid re-refining common customization for each field in schema, check out the [global component props](/renderer/global-component-props) section.
44+
45+
## Contribution
46+
47+
You can contribute to this mapper [here](https://github.com/data-driven-forms/react-forms/tree/master/packages/suir-component-mapper).
48+
49+
</Grid>
50+
<Grid item xs={false} md={2}>
51+
<ListOfContents file="mappers/suir-component-mapper" />
52+
</Grid>
53+
</Grid>

0 commit comments

Comments
 (0)