Radio Group

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

Installation

npx nx g @spartan-ng/cli:ui radiogroup

Usage

import {
  HlmRadio
  HlmRadioGroup
  HlmRadioIndicator
} from '@spartan-ng/helm/radio-group';
<hlm-radio-group>
  <label class="flex items-center" hlmLabel>
		<hlm-radio value="16.1.4">
			<hlm-radio-indicator indicator />
		</hlm-radio>
		v16.1.4
	</label>
</hlm-radio-group>

Brain API

BrnRadioGroup

Selector: [brnRadioGroup]

Inputs

PropTypeDefaultDescription
name unknown `brn-radio-group-${BrnRadioGroup._nextUniqueId++}` -
disabled boolean false Whether the radio group is disabled.
required boolean false Whether the radio group should be required.
direction 'ltr' | 'rtl' | null ltr The direction of the radio group.
value T - The value of the selected radio button.

Outputs

PropTypeDefaultDescription
change BrnRadioChange<T> - Event emitted when the group value changes.
valueChanged T - The value of the selected radio button.

BrnRadio

Selector: brn-radio

ExportAs: brnRadio

Inputs

PropTypeDefaultDescription
disabled boolean false Whether the radio button is disabled.
id string | undefined undefined The unique ID for the radio button input. If none is supplied, it will be auto-generated.
aria-label string | undefined undefined -
aria-labelledby string | undefined undefined -
aria-describedby string | undefined undefined -
value* (required) T - The value this radio button represents.
required boolean false Whether the radio button is required.

Outputs

PropTypeDefaultDescription
change BrnRadioChange<T> - Event emitted when the checked state of this radio button changes.

Helm API

HlmRadioGroup

Selector: hlm-radio-group

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmRadioIndicator

Selector: hlm-radio-indicator

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmRadio

Selector: hlm-radio

Inputs

PropTypeDefaultDescription
class ClassValue --
id string | undefined undefined Used to set the id on the underlying brn element.
aria-label string | undefined undefined Used to set the aria-label attribute on the underlying brn element.
aria-labelledby string | undefined undefined Used to set the aria-labelledby attribute on the underlying brn element.
aria-describedby string | undefined undefined Used to set the aria-describedby attribute on the underlying brn element.
value* (required) T - The value this radio button represents.
required unknown false Whether the checkbox is required.
disabled unknown false Whether the checkbox is disabled.

Outputs

PropTypeDefaultDescription
change BrnRadioChange<T> - Event emitted when the checked state of this radio button changes.

Examples

Card Layout

Scroll Area Progress