Files
twenty/packages/twenty-docs/l/cs/twenty-ui/input/radio.mdx
T
github-actions[bot] 8cadd00d34 i18n - translations (#15799)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-11-13 16:34:00 +01:00

105 lines
4.0 KiB
Plaintext

---
title: Rádio
image: /images/user-guide/create-workspace/workspace-cover.png
---
<Frame>
<img src="/images/user-guide/create-workspace/workspace-cover.png" alt="Header" />
</Frame>
Používá se, když uživatelé mohou vybrat pouze jednu možnost ze série možností.
<Tabs>
<Tab title="Usage">
```jsx
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"
/>
);
};
```
</Tab>
<Tab title="Props">
| Vlastnosti | Typ | Popis |
| --------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
| styl | Vlastnosti `React.CSS` | Další inline styly pro komponentu |
| className | textový řetězec | Volitelná CSS třída pro dodatečné stylování. |
| zaškrtnuté | booleovská hodnota | Indicates whether the radio button is checked |
| hodnota | textový ř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 | textový řetězec | Velikost radiobuttonu. Možnosti zahrnují: `velký` a `malý` |
| neaktivní | booleovská hodnota | If `true`, the radio button is disabled and not clickable |
| labelPosition | textový řetězec | Pozice textu označení vzhledem k radiobuttonu. Má dvě možnosti: `vlevo` a `vpravo` |
</Tab>
</Tabs>
## Radio Group
Groups together related radio buttons.
<Tabs>
<Tab title="Usage">
```jsx
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>
);
};
```
</Tab>
<Tab title="Props">
| Vlastnosti | Typ | Popis |
| --------------- | ----------------- | ----------------------------------------------------------------------------------------------------- |
| hodnota | textový ř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 |
</Tab>
</Tabs>