Skip to content

Radio

Radio

Form input component for selecting a single option from a set of mutually exclusive choices.

Import

import { RadioComponent } from '@primitivekit/angular';

Basic Usage

<pk-radio>Content</pk-radio>

Props

No props available.

Customization

The Radio component supports CSS variables for complete customization:

<pk-radio [style]="{
  '--radio-bg-color': '#007bff',
  '--radio-text-color': '#ffffff'
}">Custom</pk-radio>

Design Tokens

The following design tokens are available for customization:

  • --radio-size
  • --radio-border-width
  • --radio-border-color
  • --radio-border-color-hover
  • --radio-border-color-checked
  • --radio-bg-color
  • --radio-bg-color-checked
  • --radio-dot-color
  • --radio-dot-size
  • --radio-label-gap
  • … and 7 more

Accessibility

The Radio component is fully accessible and follows WCAG 2.1 AA standards:

  • ✅ Semantic HTML elements
  • ✅ Keyboard accessible
  • ✅ Focus visible indicator
  • ✅ Proper ARIA attributes
  • ✅ Screen reader compatible
  • ✅ Touch target size (44x44px minimum)
  • ✅ Color contrast compliance

Keyboard Navigation

KeyAction
TabMove focus to/from component
EnterActivate component
SpaceActivate component

Related Components

  • Button - Interactive button component with multiple variants, sizes, and states for triggering actions.
  • Input - Text input field component with validation, icons, and various input types.
  • Select - Dropdown component for selecting one or multiple options from a list.
  • Checkbox - Form input component for selecting one or multiple options from a set.
  • Switch - Toggle component for switching between two states, typically on/off or enabled/disabled.

See Also