Trongate CSS Docs

Form Elements

This guide explores the various form elements available in Trongate CSS and demonstrates their behaviors, states, and common usage patterns.

Input Field States

Every form input has multiple visual states to provide clear user feedback:

Input Type Variations

Different input types provide specialized functionality while maintaining consistent styling:

Select Elements

Select dropdowns support option grouping for better organization:

Textarea Variations

Textareas can be configured for different use cases:

Input Groups

In the example below, two buttons are positioned side-by-side by adding the .flex-row class to a containing element.

Below is the source code for the example shown above. Notice how the second form field contains a class of .ml-1. The purpose of this additional class is to add a left margin (with a value of '1em') onto the second form field element, thereby creating a small gap between the two form fields.

Horizontal Search Bar

The example below uses .flex-row, a little custom CSS to produce an attractive horizontal search bar. The search button contains a Font Awesome icon. The icon depicts a small magnifying glass (a commonly used icon for submit buttons that appear on search forms).

To get the magnifying glass icon appearing, you'll have to load Font Awesome into your webpage. This can be achieved by adding the following line of code onto the <head> section of your webpage:

Checkbox and Radio Groups

Checkboxes and radio buttons can be organized into intuitive groups:

Alternative Example

The example below uses classes of .mb-0 and .mt-0 to adjust top and bottom margins. The result is a more compact assortment of form elements.