File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { I18n } from "carbon-components-angular/i18n";
1212import { Observable } from "rxjs" ;
1313
1414/**
15+ * @deprecated since v5 - Use boolean
1516 * Defines the set of states for a toggle component.
1617 */
1718export enum ToggleState {
@@ -50,7 +51,8 @@ export enum ToggleState {
5051 role="switch"
5152 type="button"
5253 [attr.aria-checked]="checked"
53- (click)="onClick($event)">
54+ (click)="onClick($event)"
55+ [attr.aria-label]="ariaLabel">
5456 </button>
5557 <label
5658 class="cds--toggle__label"
@@ -143,6 +145,11 @@ export class Toggle extends Checkbox {
143145 */
144146 @Input ( ) hideLabel = false ;
145147
148+ /**
149+ * Set `aria-label` property for the button when label is empty
150+ */
151+ @Input ( ) ariaLabel : string ;
152+
146153 @HostBinding ( "class.cds--toggle--skeleton" ) @Input ( ) skeleton = false ;
147154
148155 @HostBinding ( "class.cds--toggle" ) toggleClass = true ;
You can’t perform that action at this time.
0 commit comments