Skip to content

Commit 91557c1

Browse files
authored
docs(material/radio): Update description for color input description on API page (#29333)
1 parent f7a7289 commit 91557c1

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/material/radio/radio.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ Individual radio-buttons inside of a radio-group will inherit the `name` of the
2828
`<mat-radio-group>` is compatible with `@angular/forms` and supports both `FormsModule`
2929
and `ReactiveFormsModule`.
3030

31-
### Default Color Configuration
32-
The default color for radio buttons can be configured globally using the `MAT_RADIO_DEFAULT_OPTIONS` provider
33-
34-
```
35-
providers: [{
36-
provide: MAT_RADIO_DEFAULT_OPTIONS,
37-
useValue: { color: 'accent' },
38-
}]
39-
```
40-
4131
### Accessibility
4232

4333
`MatRadioButton` uses an internal `<input type="radio">` to provide an accessible experience.
@@ -56,7 +46,7 @@ should not use the `attr.` prefix when binding these properties, as demonstrated
5646
```
5747

5848
Prefer placing all radio buttons inside of a `<mat-radio-group>` rather than creating standalone
59-
radio buttons because groups are easier to use exclusively with a keyboard.
49+
radio buttons because groups are easier to use exclusively with a keyboard.
6050

6151
You should provide an accessible label for all `<mat-radio-group>` elements via `aria-label` or
62-
`aria-labelledby`.
52+
`aria-labelledby`.

src/material/radio/radio.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ export const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {
7474
export const MAT_RADIO_GROUP = new InjectionToken<MatRadioGroup>('MatRadioGroup');
7575

7676
export interface MatRadioDefaultOptions {
77+
/**
78+
* Theme color of the radio button. This API is supported in M2 themes only, it
79+
* has no effect in M3 themes.
80+
*
81+
* For information on applying color variants in M3, see
82+
* https://material.angular.io/guide/theming#using-component-color-variants.
83+
*/
7784
color: ThemePalette;
7885
}
7986

@@ -481,11 +488,17 @@ export class MatRadioButton implements OnInit, AfterViewInit, DoCheck, OnDestroy
481488
this._required = value;
482489
}
483490

484-
/** Theme color of the radio button. */
491+
/**
492+
* Theme color of the radio button. This API is supported in M2 themes only, it
493+
* has no effect in M3 themes.
494+
*
495+
* For information on applying color variants in M3, see
496+
* https://material.angular.io/guide/theming#using-component-color-variants.
497+
*/
485498
@Input()
486499
get color(): ThemePalette {
487-
// As per Material design specifications the selection control radio should use the accent color
488-
// palette by default. https://material.io/guidelines/components/selection-controls.html
500+
// As per M2 design specifications the selection control radio should use the accent color
501+
// palette by default. https://m2.material.io/components/radio-buttons#specs
489502
return (
490503
this._color ||
491504
(this.radioGroup && this.radioGroup.color) ||

tools/public_api_guard/material/radio.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export class MatRadioChange {
109109

110110
// @public (undocumented)
111111
export interface MatRadioDefaultOptions {
112-
// (undocumented)
113112
color: ThemePalette;
114113
}
115114

0 commit comments

Comments
 (0)