-
Notifications
You must be signed in to change notification settings - Fork 82
/
Form.js
44 lines (38 loc) · 1023 Bytes
/
Form.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react';
import styled from '@emotion/styled';
import { Heading } from './components/Heading';
import Select from '../../../src';
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live';
import theme from 'prism-react-renderer/themes/github';
const code = `<form>
<Select
options={options}
values={[]}
required
multi
name="select"
onChange={(value) => console.log(value)}
/>
<button>Send</button>
</form>`;
const Form = ({ options, title }) => (
<React.Fragment>
<Heading
title={title}
source="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/examples/Form.js"
/>
<LiveProvider theme={theme} code={code} scope={{ Select, options }}>
<LiveEditor />
<br />
<LiveError />
<LivePreview />
</LiveProvider>
</React.Fragment>
);
Form.propTypes = {};
const Title = styled.div`
display: flex;
justify-content: space-between;
align-items: baseline;
`;
export default Form;