Skip to main content

RadioGroup

shadow

The RadioGroup serves as a container for a group of radio buttons. Allows users to select one option from a set of options, ensuring that only one radio button within a group is selected at any given time. The component supports the inline attribute, which, when set, arranges the radio buttons in a horizontal layout. In addition, it programmatically manages the value attribute, which reflects the value of the currently selected radio button.

When to use​

Use wje-radio-group when the user enters a value, selects options, or performs an action in a form.

When not to use​

Don't just use it as a visual decorative element without interaction. In this case, give priority to the presentation components.

Accessibility​

Always link the component to the description (label/aria-label), keep keyboard control, and display a clear message on validation errors.

  • Keep validation rules and error states consistent across the entire form.
  • For asynchronous operations, display the load status or disabled status.
  • For complex forms, prefer smaller sections and immediate feedback.

Attributes and properties​

disabled​

PopisVypína používateľskú interakciu s komponentom.
Atribútdisabled
Typboolean
Predvolené-

invalid​

PopisRiadi validáciu alebo stavové hlášky pre voľbu invalid.
Atribútinvalid
Typboolean
Predvolenéfalse

label​

PopisNastavuje zobrazený alebo prístupný textový štítok.
Atribútlabel
Typstring
Predvolené-

required​

PopisOznačí komponent ako povinný pre validáciu formulára.
Atribútrequired
Typstring
Predvolenéfalse

value​

PopisNastavuje aktuálnu hodnotu komponentu.
Atribútvalue
Typstring
Predvolené-

Events​

NázovPopis
wje-radio-group:changeVyvolá sa pri zmene hodnoty komponentu.

Methods​

getRadioByValue​

PopisVráti radio by hodnotu z aktuálneho stavu komponentu.
Signatúra(value: string) => Radio

removeCheck​

PopisOdstráni check z aktuálneho stavu komponentu.
Signatúra() => void

checkRadio​

PopisSpustí metódu checkRadio na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(radio: any) => void

getAllElements​

PopisVráti všetky elements z aktuálneho stavu komponentu.
Signatúra() => HTMLElement[]

CSS shadow parts​

Pre tento komponent nie sú dostupné žiadne CSS časti tieňa.

CSS custom variables​

Pre tento komponent nie sú dostupné žiadne vlastné CSS vlastnosti.

Slots​

NázovPopis
defaultPredvolený slot pre hlavný obsah komponentu.