Skip to content

Radio button

Design guidelines

Use radio buttons where users must make a single selection.

HTML
React
Angular
Option 1 Help or instructional text goes here Option 2
<certara-form-group label="Enabled group" variant="fieldset">
<certara-radio layout="stacked" name="example-01">
Option 1
<span slot="help">Help or instructional text goes here</span>
</certara-radio>
<certara-radio layout="stacked" name="example-01">Option 2</certara-radio>
</certara-form-group>
import { CertaraFormGroup, CertaraRadio } from '@certara/certara-ui-react';
<CertaraFormGroup label="Enabled group" variant="fieldset">
<CertaraRadio layout="stacked" name="example-01">
Option 1
<span slot="help">Help or instructional text goes here</span>
</CertaraRadio>
<CertaraRadio layout="stacked" name="example-01">Option 2</CertaraRadio>
</CertaraFormGroup>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-form-group label="Enabled group" variant="fieldset">
<certara-radio layout="stacked" name="example-01">
Option 1
<span slot="help">Help or instructional text goes here</span>
</certara-radio>
<certara-radio layout="stacked" name="example-01">Option 2</certara-radio>
</certara-form-group>

checked

Attributechecked
Typeboolean
Defaultfalse
Requiredfalse
DescriptionThe checked state of the radio

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionThe disabled state of the radio

layout

Attributelayout
Type"inline" | "inline-block" | "stacked" | "standalone"
Default'inline'
Requiredfalse
DescriptionStacked radios have one per line, inline radios are all on the same line

name

Attributename
Typestring
Defaultundefined
Requiredfalse
DescriptionThe name of the radio

size

Attributesize
Type"md" | "sm"
Default'md'
Requiredfalse
DescriptionThe size of the checkbox

value

Attributevalue
Typeany
Default'on'
Requiredfalse
DescriptionThe value of the radio
NameDescriptionBubbles
certaraBlurStandard event emitted when radio is blurredtrue
certaraChangeStandard event emitted when radio is toggledfalse
certaraFocusStandard event emitted when radio is focusedtrue

There are no public methods available for this component

NameDescription
Content for the label
helpHelp text that sits below the label
Option 1 Help or instructional text goes here Option 2 Disabled off Disabled on

Radio buttons should:

  • Always be used with an associated label component.
  • Be part of a list of radio buttons that:
    • Include at least two or more choices.
    • Are used to have users select only one option.
    • Include mutually exclusive options — this means that each option must be independent from every other option in the list. For example: Red, blue, and yellow are mutually exclusive. Red, blue, yellow, red/blue are not mutually exclusive.
    • List options in a rational order that makes logical sense.
    • Have a default option selected whenever possible.
      • A default option should only be avoided when the choices relate to a user’s privacy preferences, such as notifications settings, or sensitive personal information, such as gender.
  • Keep radio labels short and descriptive.
  • Start all radio buttons labels with a capital letter.
  • Don’t include punctuation after radio button labels.
  • Move focus to each radio using the tab key (or shift + tab when tabbing backwards)
  • To interact with the radio when it has keyboard focus, press the space key
View component in Figma