diff --git a/src/components/checkbox/index.js b/src/components/checkbox/index.js index 17e3e44b10..967cca1fdc 100644 --- a/src/components/checkbox/index.js +++ b/src/components/checkbox/index.js @@ -37,6 +37,9 @@ export function updateSwitchHandle($handle, checked, animateToggle = true) { * @property {string} [id] * @property {string} [size] * @property {"checkbox"|"radio"} [type] + * @property {string} [title] + * @property {string} [ariaLabel] + * @property {string} [description] */ /** @@ -51,14 +54,30 @@ export function updateSwitchHandle($handle, checked, animateToggle = true) { * @returns {Checkbox & HTMLLabelElement} */ function Checkbox(text, checked, name, id, type, ref, size, isSwitch) { + let title; + let ariaLabel; + let description; if (typeof text === "object") { - ({ text, checked, name, id, type, ref, size, isSwitch } = text); + ({ + text, + checked, + name, + id, + type, + ref, + size, + isSwitch, + title, + ariaLabel, + description, + } = text); } size = size || "1rem"; const $input = ref || Ref(); const $handle = Ref(); + const label = ariaLabel || title; const $checkbox = (