Develop
Styles
Section titled “Styles”A control is the base interactive element used in form fields, available as a button or input.
Button
Section titled “Button”Use a control button to trigger custom dropdowns, date pickers, or other interactive elements.
<div class="tng-control"> <button class="tng-control-button">Select an item</button></div>Use an input control to allow users to enter text or data.
<div class="tng-control"> <input class="tng-control-input" type="text" /></div>Elements
Section titled “Elements”Icon Button
Section titled “Icon Button”<div class="tng-control"> <input class="tng-control-input" type="text" /> <button class="p-absolute tng-icon-button is-ghost" aria-label="More info" > <i aria-hidden="true" class="tng-icon icon-info"></i> </button></div><div class="tng-control"> <i aria-hidden="true" class="tng-icon icon-car"></i> <button class="tng-control-button">Select model</button> <i aria-hidden="true" class="tng-icon icon-chevron-down"></i></div>A dynamic label can be combined with an input control to provide context about the expected input. The label will shrink and move above the input field when the user focuses on the input.
<div class="tng-control"> <label class="tng-control-label">Email address</label> <input class="tng-control-input" type="text" /></div><div class="tng-control"> <label class="tng-control-label is-lg">Email address</label> <input class="tng-control-input" type="text" /></div>Required
Section titled “Required”In case of an input control you can rely on the native HTML required attribute to indicate that a form control is required. If that’s not an option, you can use the is-required class anywhere within the control to show the required state.
<div class="tng-control"> <button class="tng-control-button is-required"> Select an item </button> <i aria-hidden="true" class="tng-icon icon-chevron-down"></i></div><div class="tng-control"> <label class="tng-control-label">Email address</label> <input class="tng-control-input" type="text" required /></div>States
Section titled “States”Disabled
Section titled “Disabled”<div class="tng-control"> <input class="tng-control-input" type="text" disabled /></div><div class="tng-control"> <button class="tng-control-button" disabled>Select an item</button></div>Invalid
Section titled “Invalid”<div class="tng-control is-invalid"> <input class="tng-control-input" type="text" /></div>