<script lang="ts">
import * as RadioGroup from "$lib/components/ui/radio-group/index.js";
import { Label } from "$lib/components/ui/label/index.js";
</script>
<RadioGroup.Root value="comfortable">
<div class="flex items-center space-x-2">
<RadioGroup.Item value="default" id="r1" />
<Label for="r1">기본</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroup.Item value="comfortable" id="r2" />
<Label for="r2">편안함</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroup.Item value="compact" id="r3" />
<Label for="r3">압축</Label>
</div>
</RadioGroup.Root> 설치
Install bits-ui:
다음 코드를 프로젝트에 복사하여 붙여넣으세요.
사용법
<script lang="ts">
import { Label } from "$lib/components/ui/label/index.js";
import * as RadioGroup from "$lib/components/ui/radio-group/index.js";
</script> <RadioGroup.Root value="option-one">
<div class="flex items-center space-x-2">
<RadioGroup.Item value="option-one" id="option-one" />
<Label for="option-one">옵션 1</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroup.Item value="option-two" id="option-two" />
<Label for="option-two">옵션 2</Label>
</div>
</RadioGroup.Root>