/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/checkboxGroup` component represents a checkbox group that enables selection of single or multiple options. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-checkbox-group/documentation |Lightning Checkbox Group Documentation} */ declare module "lightning/checkboxGroup" { import { LightningElement } from "lwc"; /** * A checkbox group that enables selection of single or multiple options. */ export default class LightningCheckboxGroup extends LightningElement { /** * Text label for the checkbox group. */ label: string; /** * Array of label-value pairs for each checkbox. */ options: Array<{ label: string; value: string }>; /** * Optional message to be displayed when no checkbox is selected * and the required attribute is set. */ messageWhenValueMissing: string; /** * The name of the checkbox group. */ name: string; /** * The list of selected checkboxes. * Each array entry contains the value of a selected checkbox. * The value of each checkbox is set in the options attribute. */ value: string[]; /** * If present, the checkbox group is disabled. * Checkbox selections can't be changed for a disabled checkbox group. */ disabled: boolean; /** * If present, at least one checkbox must be selected. */ 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. * Returns the ValidityState object for the checkbox group. */ 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 checkbox value is submitted. */ setCustomValidity(message: string): void; /** * Displays an error message if the checkbox value is required and no option is selected. */ showHelpMessageIfInvalid(): void; /** * Sets focus on the first checkbox input element. */ focus(): void; } }