🤩
Windframe Import Update is finally here.

Radio

Angular Bootstrap Radio

Angular Bootstrap Radio button is a component used for allowing a user to make a single choice among many options, while Checkboxes are for selecting multiple options.

Importing the Contrast Angular Bootstrap Radio Module

To use the Contrast Angular Bootstrap Radio component in your project you need to import RadioModule.

typescript
import {RadioModule } from 'cdbangular';

Single Radio

Use the Contrast Angular Bootstrap CDBRadio component to create radio buttons.

Angular Bootstrap Radio

html
html
<CDBRadio value="Choice 1" fill="#eb7434" colorfill="#eb7434"></CDBRadio>
<CDBRadio value="Choice 2" fill="green" colorfill="red"></CDBRadio>
<CDBRadio value="Choice 3" fill="#000000" colorfill="#000000"></CDBRadio>

Radio Group

Creating multiple radio buttons may be hectic, and with the Contrast Angular Bootstrap RadioGroup component, frankly unnecessary.

With CDBRadioGroup component, you have an [answers] prop. This [answers] prop takes in an array of choices and creates multiple radio buttons.

Angular Bootstrap Radio Group

html
html
<CDBRadioGroup fill="#eb7434" colorfill="#eb7434" [answers]="['Choice 1', 'Choice 2' , 'Choice 3' , 'Choice 4' ]"></CDBRadioGroup>

API

This section will build on your information about the props you get to use with the Contrast React Bootstrap Radio component. You will find out what these props do, their default values, and how you would use them in your code.

API Reference: Contrast Radio Props

The table below lists other prop options of the CDBRadio.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
fillString#455ff5Sets the color of the unselected radio buttonfill="#000000"
colorfillStringSets the color of the selected radio buttoncolorFill="#000000"
valueStringThe value of the input elementvalue="Choice1"

API Reference: Contrast Radio Group Props

The table below lists other prop options of the CDBRadioGroup.

NameTypeDefaultDescriptionExample
classNameStringAdds custom classesclass="myClass"
fillString#455ff5Sets the color of the unselected radio buttonfill="#000000"
colorfillStringSets the color of the selected radio buttoncolorFill="#000000"
answersArray[]The list of values of the input elementanswers=[choice1, choice2, choice3]

Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help reduce the amount of time we spend doing that, so we can focus on building some other aspects of the project. Contrast Bootstrap PRO consists of a UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

ad-banner

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast