Form Components
radio-button-group
Overview
The radio-button-group
component is a UI component that allows users to select a single option from a list of options.
This component is used in the scheduling form to input radio button type inputs.
Version | 1.1.4 |
Install (React) | npm install @nylas/react |
Import (React) | import { RadioButtonGroup } from '@nylas/react'; |
Import (CDN) | <script type="module">
import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/radio-button-group/radio-button-group.es.js";
defineCustomElement();
</script> |
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
defaultSelectedValue | The default selected value of the radio group. | string | '' | |
label | The label of the radio group. This is displayed above the radio group. Label is optional. You can also use the slot ‘label’ to add a label. | string | undefined | undefined | |
name | The name of the radio group. This is used to identify the radio group when submitting a form. | string | 'radio-group' | |
options | The list of options in the radio group. Each option has a label and a value and an optional description. | { label: string; value: string; description?: string | undefined; }[] | [] | |
required | Whether the radio group is required. If true, the radio group must have a value when submitting a form. Default is false. If the radio group is required and the value is empty, an error message is displayed. | boolean | false |
Events
Event | Description | Type |
---|---|---|
nylasFormRadioChanged | This event is fired when the selected value changes. | CustomEvent<{ value: string; name: string; label?: string | undefined; }> |
Graph
Built with StencilJS