Contentstack Styleguide

3 #Forms Forms

Build simple forms with labels, inputs, errors and option groups.

Source: 3_Form/forms.less, line 1
Example
Markup
<div class="cs-form-group">
    <label class="field-label">Name</label>
    <input type="text" class="cs-text-box w-100">
</div>
<div class="cs-form-group">
    <label class="field-label">Bio</label>
    <textarea class="cs-text-box w-100"></textarea>
</div>
Source: 3_Form/forms.less, line 9
Example
Markup
<div class="cs-form-group">
    <label class="field-label">Name</label>
    <input type="text" class="cs-text-box w-100" disabled>
</div>
<div class="cs-form-group">
    <label class="field-label">Bio</label>
    <textarea class="cs-text-box w-100" disabled></textarea>
</div>
Source: 3_Form/forms.less, line 27
Example
Something went wrong!
Markup
<div class="cs-form-group">
   <label class="field-label">Name</label>
   <input type="text" class="cs-text-box w-100 has-error">
   <span class="invalid">Something went wrong!</span>
</div>
Source: 3_Form/forms.less, line 45
Example
Markup
<div class="cs-checkbox">
   <label>
      <input type="checkbox" class="cs">
      <span class="lbl">Check this</span>
  </label>
</div>
<div class="cs-checkbox">
   <label>
      <input type="checkbox" class="cs" checked>
      <span class="lbl">Or check that</span>
  </label>
</div>
<div class="cs-checkbox">
   <label>
      <input type="checkbox" class="cs" disabled>
      <span class="lbl">This option is disabled</span>
  </label>
</div>
Source: 3_Form/forms.less, line 60
Example
Markup
<div class="cs-checkbox">
   <label>
      <input type="radio" class="cs" name="radio">
      <span class="lbl">Member</span>
  </label>
   <label>
      <input type="radio" class="cs" name="radio" checked>
      <span class="lbl">Admin</span>
  </label>
</div>
Source: 3_Form/forms.less, line 88