enes

Radio Button

Documentation for the Radio Button component.

Usage

<script>
	import { RadioButton } from 'fluentui-svelte';
</script>

<RadioButton label="Option 1" />

Component API

A brief explanation of the props that really need explaining. You can see the rest of the props in the Component Props section below.

Grouping

While you can use name="inputName" to group items and have only one checked, you can use bind:group=undefined to update that variable with the value of the selected input and inspect it in your console. Read More

Disabled

The disabled prop can be used to disable a radio button, preventing user interaction.

Checked

The checked prop allows you to control the checked state of the radio button. This is useful for controlled components.

Component Props

NameTypeDescription
labelstringThe label text for the radio button.
groupunknownBindable value representing a group of radio inputs that the input will be bound to.
checkedbooleanIndicates whether the radio button is checked.
disabledbooleanIndicates whether the radio button is disabled.
refHTMLInputElementGets the DOM reference of the radio button element.
Element AttributesAll standard HTML attributes for input elements can be applied.