chore(radio): add documentation

PiperOrigin-RevId: 501139954
This commit is contained in:
Elizabeth Mitchell 2023-01-10 17:56:40 -08:00 committed by Copybara-Service
parent bf1c13286b
commit d5c927a88f
2 changed files with 23 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import {SingleSelectionController} from './single-selection-controller.js';
const CHECKED = Symbol('checked');
/**
* @fires checked
* A radio component.
*/
export class Radio extends LitElement {
static override shadowRootOptions:
@ -31,6 +31,9 @@ export class Radio extends LitElement {
static formAssociated = true;
/**
* Whether or not the radio is selected.
*/
@property({type: Boolean, reflect: true})
get checked() {
return this[CHECKED];
@ -48,6 +51,9 @@ export class Radio extends LitElement {
[CHECKED] = false;
/**
* Whether or not the radio is disabled.
*/
@property({type: Boolean, reflect: true}) disabled = false;
/**

View File

@ -16,7 +16,22 @@ declare global {
}
}
/** @soyCompatible */
/**
* @summary Radio buttons allow users to select one option from a set.
*
* @description
* Radio buttons are the recommended way to allow users to make a single
* selection from a list of options.
*
* Only one radio button can be selected at a time.
*
* Use radio buttons to:
* - Select a single option from a set
* - Expose all available options
*
* @final
* @suppress {visibility}
*/
@customElement('md-radio')
export class MdRadio extends Radio {
static override styles = [styles, forcedColorsStyles];