Skip to content

Commit

Permalink
chore(radio): add documentation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 501139954
  • Loading branch information
asyncLiz authored and Copybara-Service committed Jan 11, 2023
1 parent bf1c132 commit d5c927a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
8 changes: 7 additions & 1 deletion radio/lib/radio.ts
Expand Up @@ -23,14 +23,17 @@ import {SingleSelectionController} from './single-selection-controller.js';
const CHECKED = Symbol('checked');

/**
* @fires checked
* A radio component.
*/
export class Radio extends LitElement {
static override shadowRootOptions:
ShadowRootInit = {...LitElement.shadowRootOptions, delegatesFocus: true};

static formAssociated = true;

/**
* Whether or not the radio is selected.
*/
@property({type: Boolean, reflect: true})
get checked() {
return this[CHECKED];
Expand All @@ -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;

/**
Expand Down
17 changes: 16 additions & 1 deletion radio/radio.ts
Expand Up @@ -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];
Expand Down

0 comments on commit d5c927a

Please sign in to comment.