Radio Group
<gstock-radio-group>
|
GstockRadioGroup
API
Propiedades
| Nombre | Descripción | Reflects | Tipo | Por defecto |
|---|---|---|---|---|
form
|
By default, form controls are associated with the nearest containing
<form> element. This attribute allows you to place the
form control outside of a form and associate it with the form that has
this id. The form must be in the same document or shadow root
for this to work.
|
|
string
|
''
|
label
|
The radio group’s label. Required for proper accessibility. If you need to
display HTML, use the label slot instead.
|
string
|
''
|
|
helpText
help-text
|
The radio groups’s help text. If you need to display HTML, use the
help-text slot instead.
|
string
|
''
|
|
name
|
The name of the input, submitted as a name/value pair with form data. |
string
|
'option'
|
|
required
|
Indicate if it is mandatory, select an option. True or false. |
|
boolean
|
false
|
size
|
The radio group’s size. This size will be applied to all child radios and radio buttons. |
|
'small' | 'medium' | 'large'
|
'medium'
|
value
|
The current value of the input, submitted as a name/value pair with form data. |
|
string
|
''
|
validity
|
Gets the validity state object |
-
|
-
|
|
validationMessage
|
Gets the validation message |
-
|
-
|
|
updateComplete
|
A read-only promise that resolves when the component has finished updating. |
Aprende más sobre atributos y propiedades .
Eventos
| Nombre | React Event | Descripción | Event Detail |
|---|---|---|---|
gstock-change-event
|
onGstockChangeEvent
|
Emitted when the radio group’s selected value changes. | - |
gstock-input-event
|
onGstockInputEvent
|
Emitted when the radio group receives user input. | - |
gstock-invalid-event
|
onGstockInvalidEvent
|
Emitted when the form control has been checked for validity and its constraints aren’t satisfied. | - |
Aprende más sobre eventos .
Slots
| Nombre | Descripción |
|---|---|
default
|
The default slot where <gstock-radio> or
<gstock-radio-button> elements are placed.
|
label
|
The radio group’s label. Required for proper accessibility. Alternatively,
you can use the label attribute.
|
help-text
|
Text that describes how to use the radio group. Alternatively, you can use
the help-text attribute.
|
Aprende más sobre slots .
Métodos
| Nombre | Descripción |
|---|---|
checkValidity( )
|
Checks for validity but does not show a validation message. Returns
true when valid and false when invalid.
|
getForm( )
|
Gets the associated form, if one exists. |
reportValidity( )
|
Checks for validity and shows the browser’s validation message if the control is invalid. |
setCustomValidity(
|
Sets a custom validation message. Pass an empty string to restore validity. |
Aprende más sobre métodos .
Partes
| Nombre | Descripción |
|---|---|
form-control
|
The form control that wraps the label, input, and help text. |
form-control-label
|
The label’s wrapper. |
form-control-input
|
The input’s wrapper. |
form-control-help-text
|
The help text’s wrapper. |
button-group
|
The button group that wraps radio buttons. |
button-group__base
|
The button group’s base part. |
Aprende más sobre partes CSS .
Dependencias
Este componente importa automáticamente las siguientes dependencias.