-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve sections Improve Form docs
- Loading branch information
Showing
9 changed files
with
133 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { Button, Form, FormGroup, Input } from 'sveltestrap'; | ||
let validated = false; | ||
</script> | ||
|
||
<Form {validated} on:submit={(e) => e.preventDefault()}> | ||
<FormGroup> | ||
<Input | ||
feedback="This requires a value" | ||
placeholder="This requires a value" | ||
required | ||
/> | ||
</FormGroup> | ||
<FormGroup> | ||
<Input | ||
feedback="This requires an email" | ||
placeholder="This requires an email" | ||
required | ||
type="email" | ||
/> | ||
</FormGroup> | ||
<Button type="submit" on:click={() => (validated = true)}>Fake Submit</Button> | ||
</Form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import Example from '../Example.svelte'; | ||
import DynamicValidation from './DynamicValidation.svelte'; | ||
import dynamicValidationSource from '!!raw-loader!./DynamicValidation.svelte'; | ||
import Validation from './Validation.svelte'; | ||
import validationSource from '!!raw-loader!./Validation.svelte'; | ||
</script> | ||
|
||
<h1>Form</h1> | ||
<a href="https://getbootstrap.com/docs/5.3/forms/validation/" target="_blank"> | ||
Bootstrap Validation | ||
</a> | ||
|
||
<Example title="Validation" source={validationSource}> | ||
<Validation /> | ||
</Example> | ||
|
||
<Example title="Dynamic Validation" source={dynamicValidationSource}> | ||
<DynamicValidation /> | ||
</Example> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script lang="ts"> | ||
import { FormGroup, Input } from 'sveltestrap'; | ||
</script> | ||
|
||
<FormGroup> | ||
<Input value="Bad value" feedback="Invalid feedback" invalid /> | ||
</FormGroup> | ||
|
||
<FormGroup> | ||
<Input value="Correct value" feedback="Valid feedback" valid /> | ||
</FormGroup> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts"> | ||
import Example from '../Example.svelte'; | ||
import Sample from './Sample.svelte'; | ||
import sampleSource from '!!raw-loader!./SimplifiedSample.svelte'; | ||
</script> | ||
|
||
<h1>Layout</h1> | ||
<a href="https://getbootstrap.com/docs/5.3/layout/grid/" target="_blank"> | ||
Bootstrap Layout Grid | ||
</a> | ||
|
||
<Example source={sampleSource}> | ||
<Sample /> | ||
</Example> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
<script lang="ts"> | ||
import Example from '../Example.svelte'; | ||
import Sample from './Sample.svelte'; | ||
import sampleSource from '!!raw-loader!./SimplifiedSample.svelte'; | ||
import Container from './Container.svelte'; | ||
import containerSource from '!!raw-loader!./Container.svelte'; | ||
</script> | ||
|
||
<h1>Layout</h1> | ||
<a href="https://getbootstrap.com/docs/5.3/layout/grid/" target="_blank"> | ||
Bootstrap Layout Grid | ||
<h1>Containers</h1> | ||
<a href="https://getbootstrap.com/docs/5.3/layout/containers/" target="_blank"> | ||
Bootstrap Containers | ||
</a> | ||
|
||
<Example source={sampleSource}> | ||
<Sample /> | ||
</Example> | ||
|
||
<Example title="Container" stacked source={containerSource}> | ||
<Container /> | ||
</Example> |