/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/radioGroup` component represents a group of radio buttons that permit only one button to be selected at a time. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-radio-group/documentation |Lightning Radio Group Documentation} */ declare module "lightning/radioGroup" { import { LightningElement } from "lwc"; /** * A radio button group that can have a single option selected. */ export default class LightningRadioGroup extends LightningElement { /** * The style of the radio group. Options are radio or button. The default is radio. */ type: "radio" | "button"; /** * Text label for the radio group. */ label: string; /** * Array of label-value pairs for each radio button. */ options: Array<{ label: string; value: string }>; /** * Optional message displayed when no radio button is selected and the required attribute is set to true. */ messageWhenValueMissing?: string; /** * Specifies the name of the radio button group. Only only one button can be selected if a name is specified * for the group. */ name: string; /** * Specifies the value of the selected radio button. */ value: string | undefined; /** * If present, the radio group is disabled and users cannot interact with it. */ disabled: boolean; /** * If present, a radio button must be selected before the form can be submitted. */ required: boolean; /** * The variant changes the appearance of the radio group. * Accepted variants include standard, label-hidden, label-inline, and label-stacked. * This value defaults to standard. * Use label-hidden to hide the label but make it available to assistive technology. * Use label-inline to horizontally align the label and radio group. * Use label-stacked to place the label above the radio group. */ variant: "standard" | "label-hidden" | "label-inline" | "label-stacked"; /** * Represents the validity states that an element can be in, with respect to constraint validation. */ validity: object; /** * Returns the valid attribute value (Boolean) on the ValidityState object. */ checkValidity(): boolean; /** * Displays the error messages and returns false if the input is invalid. * If the input is valid, reportValidity() clears displayed error messages and returns true. */ reportValidity(): boolean; /** * Sets a custom error message to be displayed when the radio group value is submitted. */ setCustomValidity(message: string): void; /** * Shows the help message if the form control is in an invalid state. */ showHelpMessageIfInvalid(): void; /** * Sets focus on the first radio input element. */ focus(): void; } }