Used when users may only choose one option from a series of options.
import { Radio } from "twenty-ui"; export const MyComponent = () => { const handleRadioChange = (event) => { console.log("Radio button changed:", event.target.checked); }; const handleCheckedChange = (checked) => { console.log("Checked state changed:", checked); }; return ( <Radio checked={true} value="Option 1" onChange={handleRadioChange} onCheckedChange={handleCheckedChange} size="large" disabled={false} labelPosition="right" /> ); };
Groups together related radio buttons.
import React, { useState } from "react"; import { Radio, RadioGroup } from "twenty-ui"; export const MyComponent = () => { const [selectedValue, setSelectedValue] = useState("Option 1"); const handleChange = (event) => { setSelectedValue(event.target.value); }; return ( <RadioGroup value={selectedValue} onChange={handleChange}> <Radio value="Option 1" /> <Radio value="Option 2" /> <Radio value="Option 3" /> </RadioGroup> ); };
As an open-source company, we welcome contributions through Github. Help us keep it up-to-date, accurate, and easy to understand by getting involved and sharing your ideas!