Skip to content

Instantly share code, notes, and snippets.

@MacRusher
Last active June 14, 2017 16:23
Show Gist options
  • Save MacRusher/3028bc275a74a4a7453ffcb699c934d4 to your computer and use it in GitHub Desktop.
Save MacRusher/3028bc275a74a4a7453ffcb699c934d4 to your computer and use it in GitHub Desktop.
Snippets for uniforms blog post
import {Grid} from 'semantic-ui-react';
import {
AutoForm, TextField, LongTextField, RadioField, SubmitField, ErrorsField
} from 'uniforms-semantic';
const CustomForm = () => (
<AutoForm
schema={BlogPostSchema}
onSubmit={(data) => /* you'll probably want to call some prop over here */}
>
<Grid>
<Grid.Row>
<Grid.Column>
<TextField name="title" />
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column>
<LongTextField name="content" />
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column width={12}>
<TextField name="authorName" />
</Grid.Column>
<Grid.Column width={4}>
<RadioField name="status" />
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column>
<SubmitField value="Ship it!" className="blue fluid" />
<ErrorsField />
</Grid.Column>
</Grid.Row>
</Grid>
</AutoForm>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment