carbon-components-svelte/tests/Form/Form.test.svelte
2025-04-12 13:34:27 -07:00

22 lines
590 B
Svelte

<script lang="ts">
import { Form, FormGroup, Checkbox, Button } from "carbon-components-svelte";
export let preventDefault = false;
</script>
<Form
data-testid="form"
on:submit={(e) => {
if (preventDefault) {
e.preventDefault();
}
console.log("submit", e);
}}
>
<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>
<Button type="submit">Submit</Button>
</Form>