klyv-ui

Radio

Forms

About

A native-feeling radio input with the selected dial drawn on it, used as the single control inside a radio group for picking one option among several.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Radio to your project and fits it to your theme.

Code

How Radio is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import Radio from "@/components/ui/radio";
import { useState } from "react";

const OPTIONS = [
  {
    value: "standard",
    label: "Standard",
    hint: "Arrives in 3 working days · free",
  },
  { value: "express", label: "Express", hint: "Arrives tomorrow · $2,48" },
  { value: "instant", label: "Instant", hint: "Arrives in minutes · $4,90" },
];

export default function RadioDemo() {
  const [value, setValue] = useState("express");

  return (
    <div className="flex w-full items-center justify-center bg-background p-10">
      <div className="w-full max-w-sm rounded-xl border border-border bg-card p-5 shadow-sm">
        <p className="mb-3 text-sm font-semibold text-foreground">
          Transfer speed
        </p>
        <div className="flex flex-col gap-3">
          {OPTIONS.map((option) => (
            <label
              key={option.value}
              className="flex cursor-pointer items-start gap-3 rounded-lg py-1"
            >
              <span className="pt-0.5">
                <Radio
                  name="transfer-speed"
                  value={option.value}
                  checked={value === option.value}
                  onChange={() => setValue(option.value)}
                />
              </span>
              <span className="flex flex-col">
                <span className="text-sm font-medium text-foreground">
                  {option.label}
                </span>
                <span className="text-xs text-muted-foreground">
                  {option.hint}
                </span>
              </span>
            </label>
          ))}
        </div>
      </div>
    </div>
  );
}

More by klyv-ui

View all
  • Gantt Chart

    Gantt Chart

    67
  • Klyv Animated Beam

    Klyv Animated Beam

    54
  • Shader Canvas

    Shader Canvas

    52
  • Pareto Chart

    Pareto Chart

    47
  • Sunburst Chart

    Sunburst Chart

    27
  • Gooey Loader

    Gooey Loader

    25
  • Fluid Canvas

    Fluid Canvas

    25
  • Gravity Tags

    Gravity Tags

    22

More in Forms

View all
  • Premium Auth

    Premium Auth

    527
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    28
  • Book A Demo 1

    Book A Demo 1

    75
  • Login 1

    Login 1

    54
  • Login Card

    Login Card

    33
  • Split Sign In Form

    Split Sign In Form

    63
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.6K