Commit 448981fc authored by Patrick H. Lauke's avatar Patrick H. Lauke
Browse files

Merge pull request #16793 from patrickhlauke/docs-input-addon-label

Add example with visible <label> and input group addon
parents cb7f5692 38c71531
4 merge requests!28721Hot test,!16831Master,!22103test,!25326Adjust examples
Showing with 13 additions and 1 deletion
+13 -1
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="bs-callout bs-callout-warning" id="callout-inputgroup-form-labels"> <div class="bs-callout bs-callout-warning" id="callout-inputgroup-form-labels">
<h4>Always add labels</h4> <h4>Always add labels</h4>
<p>Screen readers will have trouble with your forms if you don't include a label for every input. For these input groups, ensure that any additional label or functionality is conveyed to assistive technologies.</p> <p>Screen readers will have trouble with your forms if you don't include a label for every input. For these input groups, ensure that any additional label or functionality is conveyed to assistive technologies.</p>
<p>The exact technique to be used (<code>&lt;label&gt;</code> elements hidden using the <code>.sr-only</code> class, or use of the <code>aria-label</code>, <code>aria-labelledby</code>, <code>aria-describedby</code>, <code>title</code> or <code>placeholder</code> attribute) and what additional information will need to be conveyed will vary depending on the exact type of interface widget you're implementing. The examples in this section provide a few suggested, case-specific approaches.</p> <p>The exact technique to be used (visible <code>&lt;label&gt;</code> elements, <code>&lt;label&gt;</code> elements hidden using the <code>.sr-only</code> class, or use of the <code>aria-label</code>, <code>aria-labelledby</code>, <code>aria-describedby</code>, <code>title</code> or <code>placeholder</code> attribute) and what additional information will need to be conveyed will vary depending on the exact type of interface widget you're implementing. The examples in this section provide a few suggested, case-specific approaches.</p>
</div> </div>
<h2 id="input-groups-basic">Basic example</h2> <h2 id="input-groups-basic">Basic example</h2>
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)"> <input type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
<span class="input-group-addon">.00</span> <span class="input-group-addon">.00</span>
</div> </div>
<br>
<label for="basic-url">Your vanity URL</label>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">https://example.com/users/</span>
<input type="text" class="form-control" id="basic-url" aria-describedby="basic-addon3">
</div>
</form> </form>
{% highlight html %} {% highlight html %}
<div class="input-group"> <div class="input-group">
...@@ -59,6 +65,12 @@ ...@@ -59,6 +65,12 @@
<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)"> <input type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
<span class="input-group-addon">.00</span> <span class="input-group-addon">.00</span>
</div> </div>
<label for="basic-url">Your vanity URL</label>
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">https://example.com/users/</span>
<input type="text" class="form-control" id="basic-url" aria-describedby="basic-addon3">
</div>
{% endhighlight %} {% endhighlight %}
<h2 id="input-groups-sizing">Sizing</h2> <h2 id="input-groups-sizing">Sizing</h2>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment