carbon-components
Version:
The Carbon Design System is IBM’s open-source design system for products and experiences.
68 lines (61 loc) • 2.86 kB
HTML
<!--
Copyright IBM Corp. 2016, 2018
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->
<div
class="bx--form-item bx--text-input-wrapper">
<label for="text-input-3" class="bx--label">Text Input label</label>
<div class="bx--text-input__field-wrapper">
<input id="text-input-3" type="text"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text">
</div>
</div>
<div
class="bx--form-item bx--text-input-wrapper">
<label for="text-input-4" class="bx--label">Text Input label</label>
<div class="bx--text-input__field-wrapper" data-invalid>
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--text-input__invalid-icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"></path><path d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z" data-icon-path="inner-path" opacity="0"></path></svg>
<input id="text-input-4" type="text"
class="bx--text-input bx--text-input--invalid bx--text-input--light"
placeholder="Placeholder text">
</div>
<div class="bx--form-requirement">
Validation message here
</div>
</div>
<div
class="bx--form-item bx--text-input-wrapper">
<label for="text-input-5" class="bx--label">Text Input label</label>
<div class="bx--text-input__field-wrapper">
<input id="text-input-5" type="text"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text">
</div>
<div class="bx--form__helper-text">
Optional helper text goes here
</div>
</div>
<div
class="bx--form-item bx--text-input-wrapper"
style="width: 320px">
<label for="text-input-6" class="bx--label">Text Input label</label>
<div class="bx--text-input__field-wrapper">
<input id="text-input-6" type="text"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text">
</div>
<div class="bx--form__helper-text">
Optional helper text here; if message is more than one line text should wrap (~100 character count maximum)
</div>
</div>
<div
class="bx--form-item bx--text-input-wrapper">
<label for="text-input-7" class="bx--label bx--label--disabled">Text Input label</label>
<div class="bx--text-input__field-wrapper">
<input id="text-input-7" type="text"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
disabled>
</div>
<div class="bx--form__helper-text bx--form__helper-text--disabled">
Optional helper text goes here
</div>
</div>