-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a11y(radio): Add radio buttons accessibility demo page (#5958)
* Add page for radio * address comments * add description
- Loading branch information
1 parent
34ec068
commit 53e3fd9
Showing
6 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<section> | ||
<h2>Radio buttons in group</h2> | ||
<md-radio-group name="seasons" [(ngModel)]="favoriteSeason" aria-label="Seasons"> | ||
<md-radio-button *ngFor="let season of seasonOptions" [value]="season"> | ||
{{season}} | ||
</md-radio-button> | ||
</md-radio-group> | ||
</section> | ||
|
||
<section> | ||
<h2>Radio buttons with align-end label position</h2> | ||
<md-radio-group name="bread" align="end" aria-label="Breads"> | ||
<md-radio-button value="toast">Toast</md-radio-button> | ||
<md-radio-button value="biscuit">Biscuit</md-radio-button> | ||
<md-radio-button value="bagel">Bagel</md-radio-button> | ||
</md-radio-group> | ||
</section> | ||
|
||
<section> | ||
<h2>Disabled radio buttons</h2> | ||
<p> | ||
This section contains three radio buttons for "Yes", "No", and "Maybe". | ||
The "Maybe" radio button is disabled. | ||
</p> | ||
<md-radio-button name="disable">Yes</md-radio-button> | ||
<md-radio-button name="disable">No</md-radio-button> | ||
<md-radio-button name="disable" [disabled]="true">Maybe</md-radio-button> | ||
</section> | ||
|
||
<section> | ||
<h2>Radio buttons with different colors</h2> | ||
<md-radio-button name="color">Default (accent)</md-radio-button> | ||
<md-radio-button name="color" color="primary">Primary</md-radio-button> | ||
<md-radio-button name="color" color="accent">Accent</md-radio-button> | ||
<md-radio-button name="color" color="warn">Warn</md-radio-button> | ||
</section> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'radio-a11y', | ||
templateUrl: 'radio-a11y.html', | ||
styleUrls: ['radio-a11y.css'], | ||
}) | ||
export class RadioAccessibilityDemo { | ||
favoriteSeason: string = 'Autumn'; | ||
seasonOptions = [ | ||
'Winter', | ||
'Spring', | ||
'Summer', | ||
'Autumn', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import {Routes} from '@angular/router'; | ||
import {ButtonAccessibilityDemo} from './button/button-a11y'; | ||
import {CheckboxAccessibilityDemo} from './checkbox/checkbox-a11y'; | ||
import {RadioAccessibilityDemo} from './radio/radio-a11y'; | ||
import {AccessibilityHome} from './a11y'; | ||
|
||
export const ACCESSIBILITY_DEMO_ROUTES: Routes = [ | ||
{path: '', component: AccessibilityHome}, | ||
{path: 'button', component: ButtonAccessibilityDemo}, | ||
{path: 'checkbox', component: CheckboxAccessibilityDemo}, | ||
{path: 'radio', component: RadioAccessibilityDemo}, | ||
]; |