mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
chore(radio): add documentation
PiperOrigin-RevId: 501139954
This commit is contained in:
parent
bf1c13286b
commit
d5c927a88f
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user