Docs
Radio Group
Radio Group
A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
Installation
npx shadcn-svelte add radio-group
npx shadcn-svelte add radio-group
Usage
<script lang="ts">
import { Label } from "$components/ui/label";
import { RadioGroup, RadioGroupItem } from "$components/ui/radio-group";
</script>
<script lang="ts">
import { Label } from "$components/ui/label";
import { RadioGroup, RadioGroupItem } from "$components/ui/radio-group";
</script>
<RadioGroup value="option-one">
<div class="flex items-center space-x-2">
<RadioGroupItem value="option-one" id="option-one" />
<Label for="option-one">Option One</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroupItem value="option-two" id="option-two" />
<Label for="option-two">Option Two</Label>
</div>
</RadioGroup>
<RadioGroup value="option-one">
<div class="flex items-center space-x-2">
<RadioGroupItem value="option-one" id="option-one" />
<Label for="option-one">Option One</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroupItem value="option-two" id="option-two" />
<Label for="option-two">Option Two</Label>
</div>
</RadioGroup>
On This Page