Skip to content

Commit 40bb9c3

Browse files
authored
Merge pull request #339 from youda97/skeleton-checkbox
feat(checkbox): Add skeleton state
2 parents d469846 + 05143cf commit 40bb9c3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/checkbox/checkbox.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ export class CheckboxChange {
7070
[attr.aria-checked]="(indeterminate ? 'mixed' : checked)"
7171
(change)="onChange($event)"
7272
(click)="onClick($event)">
73-
<label [for]="id" class="bx--checkbox-label">
73+
<label
74+
[for]="id"
75+
class="bx--checkbox-label"
76+
[ngClass]="{
77+
'bx--skeleton' : skeleton
78+
}">
7479
<ng-content></ng-content>
7580
</label>
7681
`,
@@ -107,6 +112,10 @@ export class Checkbox implements ControlValueAccessor, AfterViewInit {
107112
* Set to `true` for a disabled checkbox.
108113
*/
109114
@Input() disabled = false;
115+
/**
116+
* Set to `true` for a loading checkbox.
117+
*/
118+
@Input() skeleton = false;
110119
/**
111120
* Sets the name attribute on the `input` element.
112121
*/

src/checkbox/checkbox.stories.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ storiesOf("Checkbox", module).addDecorator(
2828
onChange: action("Change fired!"),
2929
onIndeterminateChange: action("Indeterminate change fired!")
3030
}
31-
}));
31+
}))
32+
.add("Skeleton", () => ({
33+
template: `<ibm-checkbox skeleton="true"></ibm-checkbox>`
34+
}));

0 commit comments

Comments
 (0)