help(mat-radio-button): I can't use `color` attribute in the <mat-radio-button>
See original GitHub issueWhat are you trying to do?
<mat-radio-group aria-label="Select an option">
<mat-radio-button value="1" color="primary">Option 1</mat-radio-button>
<mat-radio-button value="2" color="accent">Option 2</mat-radio-button>
<mat-radio-button value="3" color="warn">Option 3</mat-radio-button>
<mat-radio-button value="4" color="info">Option 4</mat-radio-button>
</mat-radio-group>
I want to create a custom material theme and use info
theme palette like below.
<mat-radio-button value="4" color="info">Option 4</mat-radio-button>
What troubleshooting steps have you tried?
For the other components like button, toggle, checkbox, I can use color=“info” palette.
<mat-radio-button value="4" color="info">Option 4</mat-radio-button>
I expect mat-info
class in the <mat-radio-button>
, but not working 😦
<mat-radio-button _ngcontent-csm-c296="" class="mat-radio-button example-radio-button mat-radio-checked" ng-reflect-value="Winter" id="mat-radio-2">
...
...
</mat-radio-button>
Reproduction
Steps to reproduce:
https://material.angular.io/components/radio/examples
you can add color=“info” in the <mat-radio-button>
<mat-radio-group aria-label="Select an option">
<mat-radio-button value="1" color="primary">Option 1</mat-radio-button>
<mat-radio-button value="2" color="accent">Option 2</mat-radio-button>
<mat-radio-button value="3" color="warn">Option 3</mat-radio-button>
<mat-radio-button value="4" color="info">Option 4</mat-radio-button>
</mat-radio-group>
Environment
- Angular: v13
- CDK/Material: v13
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to change color of radio button in angular material 2
I'm trying to change the color of the angular material 2 radio button on PROPER way, without overriding css. By default, it uses...
Read more >Radio button | Angular Material
<mat-radio-button> provides the same functionality as a native <input ... The default color for radio buttons can be configured globally using the ...
Read more ><mat-radio-button> in Angular Material - GeeksforGeeks
If we want to change the theme then we can change it by using the color property. In angular we have 3 themes,...
Read more >mat-radio-button, Angular material radio button Usage, Example
We can control the label position using labelPosition property of <mat-radio-button> . · If you want assign some default value to radio group...
Read more >Angular Radio button, Angular Material radio button ... - Edupala
We can configure the default color for the angular mat-radio-group component in the provider option using MAT_RADIO_DEFAULT_OPTIONS and we can assign material ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
These palettes aren’t in the Material Design specification which we need to adhere to though. Also there’s nothing stopping you from defining your own
color
directive that accepts any color:Duplicate of #11888