-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use radio buttons for picking the authority type, not a select
- Loading branch information
1 parent
ff214df
commit 0a1648b
Showing
2 changed files
with
48 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script lang="ts"> | ||
// A label for the entire group of radio buttons | ||
export let legend: string; | ||
// A unique (per page) ID of the radio group | ||
export let id: string; | ||
// A list of [value, label] representing the choices | ||
export let choices: [string, string][]; | ||
// The current value | ||
export let value: string; | ||
</script> | ||
|
||
<div class="govuk-form-group"> | ||
<fieldset class="govuk-fieldset"> | ||
<legend class="govuk-fieldset__legend">{legend}</legend> | ||
<div class="govuk-radios" data-module="govuk-radios"> | ||
{#each choices as [thisValue, thisLabel]} | ||
<div class="govuk-radios__item"> | ||
<input | ||
class="govuk-radios__input" | ||
id={id + thisValue} | ||
type="radio" | ||
bind:group={value} | ||
value={thisValue} | ||
on:change | ||
/> | ||
<label class="govuk-label govuk-radios__label" for={id + thisValue}> | ||
{thisLabel} | ||
</label> | ||
</div> | ||
{/each} | ||
</div> | ||
</fieldset> | ||
</div> |
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