
- Použití
- Vlastnosti
Kopírovat
Zeptat se AI
import { Radio } from "twenty-ui/display";
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"
/>
);
};
| Vlastnosti | Typ | Popis |
|---|---|---|
| styl | Vlastnosti React.CSS | Další inline styly pro komponentu |
| className | řetězec | Volitelná CSS třída pro další stylování |
| zaškrtnuté | booleovská hodnota | Indicates whether the radio button is checked |
| hodnota | řetězec | Označení nebo text spojený s radiobuttonem |
| onChange | funkce | The function called when the selected radio button is changed |
| onCheckedChange | funkce | The function called when the checked state of the radio button changes |
| velikost | řetězec | Velikost radiobuttonu. Možnosti zahrnují: velký a malý |
| neaktivní | booleovská hodnota | If true, the radio button is disabled and not clickable |
| labelPosition | řetězec | Pozice textu označení vzhledem k radiobuttonu. Má dvě možnosti: vlevo a vpravo |
Radio Group
Groups together related radio buttons.- Použití
- Vlastnosti
Kopírovat
Zeptat se AI
import React, { useState } from "react";
import { Radio, RadioGroup } from "twenty-ui/display";
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>
);
};
| Vlastnosti | Typ | Popis |
|---|---|---|
| hodnota | řetězec | Hodnota aktuálně vybraného radiobuttonu |
| onChange | funkce | The callback function triggered when the radio button is changed |
| přiZměněHodnoty | funkce | Funkce spouštěná při změně vybrané hodnoty ve skupině. |
| děti | React.ReactNode | Allows you to pass React components (such as Radio) as children to the Radio Group |