Angular Bootstrap Radio Button
Angular Radio Button - Bootstrap 4 & Material Design
Note: This documentation is for an older version of Bootstrap (v.4). A
newer version is available for Bootstrap 5. We recommend migrating to the latest version of our product - Material Design for
Bootstrap 5.
Go to docs v.5
The Angular Radio button is a component used to allow a user to make a single choice among many options, while Checkboxes are for selecting multiple options.
Material radio buttons MDB Pro component
Material Design styling for Bootstrap radio button component
Checked state
Add a
checked
attribute to the
<input>
element to pre-select the radio button when the page loads.
The
checked
attribute is a boolean attribute.
Disabled state
Add the
disabled
boolean attribute to the
<input>
and the custom indicator and the label description will be automatically styled and blocked.
A disabled
<input>
element is unusable and un-clickable.
Material checkbox MDB Pro component
To provide a proper cursor styling for the material radio button, apart from
the disabled
attribute you’ll also need to add the
.disabled
class to the
<label>
element.
Inline
Default radio buttons
You may group default radio buttons or checkboxes on the same horizontal row by adding
the .custom-control-inline
class to any parent element of the
<input>
element.
Material radio buttons MDB Pro component
You can also group material radio buttons or checkboxes on the same horizontal row by adding
the .form-check-inline
class to any parent element of the
<input>
element.
Template-driven forms MDB Pro component
In this section, you will find information on how to use our radio component in template-driven forms.
Remember to import the
FormsModule
into your
app.module.ts
Setting & getting the value
Bind in the two-way ngModel from component.html with template
and bind the [value]
with both templateUnchecked
and templateChecked
in the component.ts file
Reactive forms MDB Pro component
In this section, you will find information on how to use our radio component in reactive forms.
Remember to import the
ReactiveFormsModule
into your
app.module.ts
file.
Setting & getting the value
Set the default value with FormControl
and [value]
.
Angular Radio - API
In this section you will find informations about required modules and available inputs, outputs, methods and events of Angular radio component.
Modules used
In order to speed up your application, you can choose to import only the modules you actually need, instead of importing the entire MDB Angular library. Remember that importing the entire library, and immediately afterwards a specific module, is bad practice, and can cause application errors.
Angular Radio Button - examples & customization
More examples of customization Angular Radio buttons in your application.