 Search
components/accordion: Accordion components/badge: Badge components/button: Button components/checkbox: Checkbox components/dialog: Dialog components/input: Input components/mark: Mark components/popover: Popover components/pre: Pre components/progress: Progress components/radio: Radio components/separator: Separator components/spinner: Spinner components/range: Range components/switch: Switch components/table: Table components/tooltip: Tooltip components/textarea: Textarea components/typography: Typography components/view: View plugins/plugin-declarative-layout: Declarative Layout plugins/plugin-nf: Nerd Font Plugin plugins/theme-catppuccin: Catppuccin Theme plugins/theme-everforest: Everforest Theme contributing/style-guide: Style Guide contributing/style-guide: ## CSS Units contributing/style-guide: ## Selectors contributing/style-guide: ## Documentation plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers contributing/contributing: Contributing contributing/contributing: ## Local Development contributing/contributing: ## Issues contributing/contributing: ## Pull Requests installation/nextjs: Next.js installation/vite: Vite installation/astro: Astro installation/astro: ## Scoping installation/astro: ### Frontmatter Imports installation/astro: ### <style> tag installation/astro: ### Full Library Import plugins/theme-gruvbox: Gruvbox Theme plugins/theme-osmium: Osmium Theme plugins/theme-nord: Nord Theme plugins/theme-vitesse: Vitesse Theme start/ascii-boxes: ASCII Boxes start/changelog: Changelog start/installation: Installation start/intro: Introduction start/intro: ## Features start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/theming: ### Using Multiple Theme Accents start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells

Radio

Displays a radio button

1 <label>
2 <input type="radio" name="radio-group" />
3 Unchecked
4 </label>
5 <label>
6 <input type="radio" checked name="radio-group" />
7 Checked
8 </label>

Import

@import '@webtui/css/components/radio.css';

Usage

<label>
    <input type="radio" />
    Radio
</label>

Examples

disabled

1
2 <label>
3 <input type="radio" disabled name="radio-group" />
4 Disabled
5 </label>
6 <label>
7 <input type="radio" checked disabled name="radio-group" />
8 Checked Disabled
9 </label>
10

Reference

Properties

  • --placeholder-content: The content of the unchecked radio placeholder
  • --placeholder-background: The background color of the unchecked radio placeholder
  • --placeholder-color: The text color of the unchecked radio placeholder
  • --checked-content: The content of the radio button when checked
  • --checked-background: The background color of the radio button when checked
  • --checked-color: The text color of the radio button when checked
1
2 <label>
3 <input type="radio" name="default" />
4 Default
5 </label>
6 <label>
7 <input type="radio" checked name="default" />
8 Default Checked
9 </label><br/>
10 <label>
11 <input type="radio" class="custom" name="custom" />
12 Custom
13 </label>
14 <label>
15 <input type="radio" checked class="custom" name="custom" />
16 Custom Checked
17 </label>
18
1
2 input[type='radio'].custom {
3 --placeholder-content: '< >';
4 --placeholder-background: var(--background2);
5 --placeholder-color: var(--foreground1);
6 --checked-content: 'O';
7 --checked-color: red;
8 }
9

Extending

To extend the Radio stylesheet, define a CSS rule on the components layer

@layer components {
    input[type='radio'] {
        /* ... */
    }
}

Scope

  • All native <input type="radio"> elements
input[type='radio'] {
    /* ... */
}