Perhaps one of the most important components on the web, forms allow users to fill in data easily. Cirrus covers the styles of labels,inputs, textareas, selects, with support coming to more controls in the future.
Input fields in Cirrus are all designed with extra padding, different sizes, and other variations. This section covers input fields for emails, passwords, search, text, tel, and select (dropdown menus). To add margins between adjacent inputs, it is best to wrap them around the input-control class.
Currently a beta feature, this allows you to place Font Awesome glyphs right at the beginning of input fields. This only works for normal sized input fields and normal/small sized glyphs.
Below are some examples of how Font Awesome glyphs look with different textfield sizes. To add a glyph on the left side, add input-contains-icon-left to the input box inside input-control and a span sibling with classes icon icon-left. The process is the same for glyphs on the right, but the left is changed to right.
The glyphs embedded in the input fields will automatically size themselves to fit the parent.
You can also create labels to go along with the textfield to give more detail to the user. The simplest implementation is to add a title class to your main label and the subtitle class for any sub-labels.
If more info is needed to be displayed, you can easily add <span class="info">More info</span> and <span class="info inline">More info</span> (for inline displays).
Just for verification purposesWe promise we won't spam!
Text areas are a great way to allow users to input more data with multiline support compared to a regular text field.
States
Normal
<textarea>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</textarea>
<input type="submit" class="btn-primary pull-right">
Disabled
<textarea disabled>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</textarea>
<input disabled type="submit" class="btn-primary pull-right">
Cirrus allows you to use standard form controls as is such as radio buttons and checkboxes. However, Cirrus extends on that with custom styled radio buttons and checkboxes with additional classes that provide better styling.
The form-section class provides a generic container for form controls such as grouping labels and inputs together. Unlike form-group, form-section does not override default styling of labels and inputs. To display labels and inputs inline, add the section-inline class to the form-section container.
Cirrus allows you to bundle input fields in form groups with other components such as buttons, dropdown menus, or labels using the form-group class. This adds some unique styling to the elements creating a unified design when combining these components together.
<div class="form-group">
<input type="search" class="form-group-input" placeholder="Search"></input>
<button class="form-group-btn">Go</button>
</div>
<div class="form-group">
<label class="form-group-label">$</label>
<input type="number" class="form-group-input" placeholder="How much would you like to donate?"></input>
</div>
To display controls like buttons and labels on the right side, just place that component last.
And of course, more controls can be combined with each other with different sizes. To make things easier, Cirrus is designed to make components to fit with other same sized controls. For instance, any *-small class matches with all components that have the small class.