Files
textual/docs/widgets/radiobutton.md
Will McGugan f5e779c4c4 tabbed content widget (#2059)
* tabbed content widget

* TabbedContent widget and docs

* missing docs

* fix active

* doc fix

* test fix

* additional test

* test for render_str

* docstring

* changelog

* doc update

* changelog

* fix bad optimization

* Update docs/widgets/tabbed_content.md

Co-authored-by: Dave Pearson <davep@davep.org>

* fix for empty initial

* docstrings

* Update src/textual/widgets/_content_switcher.py

Co-authored-by: Dave Pearson <davep@davep.org>

* docstring

* remove log

* permit nested tabs

* renamed TabsCleared to Cleared

* added tests, fix types on click

* tests

* fix broken test

* fix for nested tabs

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-03-18 10:38:41 +00:00

1.3 KiB

RadioButton

A simple radio button which stores a boolean value.

  • Focusable
  • Container

A radio button is best used with others inside a RadioSet.

Example

The example below shows radio buttons, used within a RadioSet.

=== "Output"

```{.textual path="docs/examples/widgets/radio_button.py"}
```

=== "radio_button.py"

```python
--8<-- "docs/examples/widgets/radio_button.py"
```

=== "radio_button.css"

```sass
--8<-- "docs/examples/widgets/radio_button.css"
```

Reactive Attributes

Name Type Default Description
value bool False The value of the radio button.

Bindings

The radio button widget defines the following bindings:

::: textual.widgets._toggle_button.ToggleButton.BINDINGS options: show_root_heading: false show_root_toc_entry: false

Component Classes

The radio button widget provides the following component classes:

::: textual.widgets._toggle_button.ToggleButton.COMPONENT_CLASSES options: show_root_heading: false show_root_toc_entry: false

Messages

::: textual.widgets.RadioButton.Changed

See Also