forked from carbon-design-system/carbon-components-svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form.test.svelte
54 lines (53 loc) · 1.4 KB
/
Form.test.svelte
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
45
46
47
48
49
50
51
52
53
54
<script lang="ts">
import {
Form,
FormGroup,
Checkbox,
RadioButtonGroup,
RadioButton,
Select,
SelectItem,
Button,
} from "../types";
</script>
<Form on:submit>
<FormGroup legendText="Checkboxes">
<Checkbox id="checkbox-0" labelText="Checkbox Label" checked />
<Checkbox id="checkbox-1" labelText="Checkbox Label" />
<Checkbox id="checkbox-2" labelText="Checkbox Label" disabled />
</FormGroup>
<FormGroup legendText="Radio buttons">
<RadioButtonGroup name="radio-button-group" selected="default-selected">
<RadioButton
id="radio-1"
value="standard"
labelText="Standard Radio Button"
/>
<RadioButton
id="radio-2"
value="default-selected"
labelText="Default Selected Radio Button"
/>
<RadioButton
id="radio-4"
value="disabled"
labelText="Disabled Radio Button"
disabled
/>
</RadioButtonGroup>
</FormGroup>
<FormGroup>
<Select id="select-1" labelText="Select menu" value="placeholder-item">
<SelectItem
disabled
hidden
value="placeholder-item"
text="Choose an option"
/>
<SelectItem value="option-1" text="Option 1" />
<SelectItem value="option-2" text="Option 2" />
<SelectItem value="option-3" text="Option 3" />
</Select>
</FormGroup>
<Button type="submit">Submit</Button>
</Form>