Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
[docs] toggle switch documentation updates (#3103)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Wilken <[email protected]>
  • Loading branch information
gnomeontherun authored and hippee-lee committed Feb 15, 2019
1 parent 559bf8e commit 5790fa5
Show file tree
Hide file tree
Showing 16 changed files with 478 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h4>Basic checkbox button</h4>

<h4>Labels</h4>

<p>For anything beyond a standalone checkbox button, you'll need to wrap your checkboxs with the <code class="clr-code">ClrCheckboxWrapper</code>
<p>For anything beyond a standalone checkbox button, you'll need to wrap your checkboxes with the <code class="clr-code">ClrCheckboxWrapper</code>
component when you include a label. This manages the label and display of the checkbox button for you.
</p>

Expand All @@ -51,7 +51,7 @@ <h4>Helper and error messages</h4>
component. The checkbox button container tracks the the validations placed on a checkbox button, such as <code
class="clr-code">required</code>
or even custom built validators in Angular. Under the hood, it looks at the <code class="clr-code">NgControl</code>
values to determine the control validitity, and display the helper text or error message accordingly.</p>
values to determine the control validity, and display the helper text or error message accordingly.</p>

<p>Note: the validation in this example only displays an error after you focus and leave focus without
selecting a value. The easiest way to do this is to highlight the text in this paragraph, and hit tab a few
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<input type="checkbox" clrToggle />
12 changes: 12 additions & 0 deletions src/website/src/app/documentation/demos/toggles/ng/disabled.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<clr-toggle-container>
<label>Disabled toggle switch example</label>
<clr-checkbox-wrapper>
<input type="checkbox" clrToggle name="options" value="option1" [(ngModel)]="options" disabled />
<label>Option 1</label>
</clr-checkbox-wrapper>
<clr-checkbox-wrapper>
<input type="checkbox" clrToggle name="options" value="option2" [(ngModel)]="options" disabled />
<label>Option 2</label>
</clr-checkbox-wrapper>
<clr-control-helper>Helper text</clr-control-helper>
</clr-toggle-container>
13 changes: 13 additions & 0 deletions src/website/src/app/documentation/demos/toggles/ng/helpers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<clr-toggle-container>
<label>Full toggle switch</label>
<clr-toggle-wrapper>
<input type="checkbox" clrToggle name="options" required value="option1" [(ngModel)]="options" />
<label>Option 1</label>
</clr-toggle-wrapper>
<clr-toggle-wrapper>
<input type="checkbox" clrToggle name="options" required value="option2" [(ngModel)]="options" />
<label>Option 2</label>
</clr-toggle-wrapper>
<clr-control-helper>Helper text</clr-control-helper>
<clr-control-error>This field is required!</clr-control-error>
</clr-toggle-container>
13 changes: 13 additions & 0 deletions src/website/src/app/documentation/demos/toggles/ng/inline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<clr-toggle-container clrInline>
<label>Inline toggle switch example</label>
<clr-toggle-wrapper>
<input type="checkbox" clrToggle name="options" required value="option1" [(ngModel)]="options" />
<label>Option 1</label>
</clr-toggle-wrapper>
<clr-toggle-wrapper>
<input type="checkbox" clrToggle name="options" required value="option2" [(ngModel)]="options" />
<label>Option 2</label>
</clr-toggle-wrapper>
<clr-control-helper>Helper text</clr-control-helper>
<clr-control-error>This field is required!</clr-control-error>
</clr-toggle-container>
8 changes: 8 additions & 0 deletions src/website/src/app/documentation/demos/toggles/ng/label.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<clr-toggle-wrapper>
<input type="checkbox" clrToggle value="option1" name="options" />
<label>Option 1</label>
</clr-toggle-wrapper>
<clr-toggle-wrapper>
<input type="checkbox" clrToggle value="option2" name="options" />
<label>Option 2</label>
</clr-toggle-wrapper>

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5790fa5

Please sign in to comment.