-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathform-examples.tsx
More file actions
41 lines (39 loc) · 1.03 KB
/
form-examples.tsx
File metadata and controls
41 lines (39 loc) · 1.03 KB
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
'use client';
import {
Button,
Field,
Fieldset,
Form,
InputField,
TextArea
} from '@raystack/apsara';
import PlaygroundLayout from './playground-layout';
export function FormExamples() {
return (
<PlaygroundLayout title='Form'>
<Form
onSubmit={e => {
e.preventDefault();
alert('Form submitted!');
}}
style={{ maxWidth: 400 }}
>
<Fieldset legend='Personal Information'>
<Field label='First Name' required>
<InputField placeholder='John' />
</Field>
<Field label='Last Name' required>
<InputField placeholder='Doe' />
</Field>
</Fieldset>
<Field label='Email' required helperText="We'll send a confirmation">
<InputField type='email' placeholder='john@example.com' />
</Field>
<Field label='Message' optional>
<TextArea placeholder='Tell us more...' />
</Field>
<Button type='submit'>Submit</Button>
</Form>
</PlaygroundLayout>
);
}