Blips
Documentação

Radio Group

Um conjunto de botões selecionáveis—conhecidos como radio buttons—onde no máximo um dos botões pode estar selecionado por vez.

Carregando…
"use client";

import { Label } from "@blips/ui/components/label";
import { RadioGroup, RadioGroupItem } from "@blips/ui/components/radio-group";

export default function RadioGroupDemo() {
  return (
    <RadioGroup defaultValue="comfortable">
      <div className="flex items-center space-x-2">
        <RadioGroupItem value="default" id="r1" />
        <Label htmlFor="r1">Default</Label>
      </div>
      <div className="flex items-center space-x-2">
        <RadioGroupItem value="comfortable" id="r2" />
        <Label htmlFor="r2">Comfortable</Label>
      </div>
      <div className="flex items-center space-x-2">
        <RadioGroupItem value="compact" id="r3" />
        <Label htmlFor="r3">Compact</Label>
      </div>
    </RadioGroup>
  );
}

Instalação

pnpm add @blips/ui

Uso

import { Label } from "@blips/ui/components/label"
import { RadioGroup, RadioGroupItem } from "@blips/ui/components/radio-group"
<RadioGroup defaultValue="option-one">
  <div className="flex items-center gap-3">
    <RadioGroupItem value="option-one" id="option-one" />
    <Label htmlFor="option-one">Opção Um</Label>
  </div>
  <div className="flex items-center gap-3">
    <RadioGroupItem value="option-two" id="option-two" />
    <Label htmlFor="option-two">Opção Dois</Label>
  </div>
</RadioGroup>

Exemplos

Referência da API

Consulte a documentação do Radix UI Radio Group.