Code

Props

Props
Data Type
Required

className

string

❌

label

string

βœ…

info

string

❌

structure

-HTML tags -Custom Components (Radio)

βœ…

helptext

string

❌

disabled

boolean

❌

error

boolean

❌

errorMessage

string

❌

onChange

function event

❌

Event Response

This component is not sending any response, instead, it is just facilitating the individual Checkbox components events.

onChange

import React, {useState} from 'react';
import {
  RadioGroup,
  Radio
} from '@2600hz/sds-react-components';

const Example = ()=>{
    const [radioSelection, setRadioSelection] = useState(selectedItem);
    
    const updateState = (e)=>{
        setRadioSelection(e.value);
    }
    
    return(
        <RadioGroup
          className="checkboxGroupExample"
          errorMessage="Optional error message can offer better guidance."
          helptext="Optional help text can offer additional guidance."
          info="Optional Info Message"
          label="Checkgroup label text"
          onChange={() => {}}
        >
          <Radio
            id="example1"
            label="Example 1"
            value="example1"
            checked={checkboxList.example1}
          />
          <Radio
            id="example2"
            label="Example 2"
            value="example2"
            checked={checkboxList.example2}
          />
          <Radio
            checked={checkboxList.example3}
            id="example3"
            label="Example 3"
            value="example3"
          />
        </RadioGroup>
    )
}
circle-exclamation

Components Dependency

For this component elaboration there were used the following internal components:

Live Demo

For detailed code usage documentation, see the Storybooks for each framework below.

React

Last updated