components/radio-group.svelte

bits-ui · packages/bits-ui/src/lib/bits/radio-group/components/radio-group.svelte · svelte · MIT
ui

Reusable Svelte radio group component with state management and two-way binding for forms.

<!--
  Source: https://github.com/huntabyte/bits-ui | License: MIT | Copyright 2024 Hunter Johnston <https://github.com/huntabyte>
  Provided via justclaw.it.com; keep this notice with the code.
-->
<script lang="ts">
	import { boxWith, mergeProps } from "svelte-toolbelt";
	import type { RadioGroupRootProps } from "../types.js";
	import { RadioGroupRootState } from "../radio-group.svelte.js";
	import RadioGroupInput from "./radio-group-input.svelte";
	import { createId } from "#lib/internal/create-id.js";
	import { noop } from "#lib/internal/noop.js";

	const uid = $props.id();

	let {
		disabled = false,
		children,
		child,
		value = $bindable(""),
		ref = $bindable(null),
		orientation = "vertical",
		loop = true,
		name = undefined,
		required = false,
		readonly = false,
		autocomplet

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key