InputGroup

InputGroup

Angular Bootstrap Input group component is used for collecting data entered by users. It usually contains buttons, text areas or other inputs. With this component, your forms are attractive and easy to customize.

Basic input with appended text after

Default InputGroup example.

image info

html
<CDBInputGroup hint="Recipient's username" inputGroupClass="mb-3 mt-0" append="@example.com">
</CDBInputGroup>

Basic input with appended text before

image info

html
<CDBInputGroup inputGroupClass="flex-nowrap mb-3" prepend="@" hint="Username"></CDBInputGroup>

Run function on icon click

image info

html
<CDBInputGroup icon="bell" onIconClick="" append="Bells"></CDBInputGroup>

Small input group

image info

html
<CDBInputGroup inputGroupClass="mb-2 mt-0" prepend="Small" size="sm"></CDBInputGroup>

Large input group

image info

html
<CDBInputGroup inputGroupClass="mb-2 mt-0" prepend="Large" size="lg"></CDBInputGroup>

Input group with checkbox

image info

html
<CDBInputGroup [prepend]=example.elementRef.nativeElement>
</CDBInputGroup>
<ng-template #example>
<div class="input-group-text md-addon">
<CDBInput type="checkbox"></CDBInput>
</div>
</ng-template>

Basic input

image info

html
<CDBInputGroup></CDBInputGroup>

API

Here in this section you will find information about required modules and available inputs, outputs, methods and events of this component.

Contrast InputGroup Bootstrap Modules used

import {InputgroupModule } from 'cdbangular';

API Reference: Contrast InputGroup Inputs

The table below shows the possible input of the InputGroup component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
containerClassStringAdds custom class to wrapper divcontainerClass="wrapper"
containerIdStringAdds custom Id to wrapper divcontainerId="id"
hintStringSets the placeholder for the Inputhint="placeholder"
idStringRequired! Set the id of the input elementid="myId"
inputnodeReplaces default input for your custom elementsinputs={ <select className="browser-default custom-select"...> <option value="0" ...>Choose< .../option> <option value="1" ...>One< .../option> <... /select>} .../>
labelString or BooleandivAdds label for your inputgroup=true
labelClassStringdivAdds custom class to the labellabelClass="labelCustomClass"
appendNode or StringnullAdds suffix for your inputappend={
Send
} append="@gmail.com"
appendClassStringAdds custom class to Input Group append elementappendClass="font-italic"
prependClassStringAdds custom class to Input Group prepend elementprependClass="font-italic"
sizeStringlgChanges size of the component; available lg and smsize="lg"
typeStringtextThe type of the input elementtype="textarea"
validateBooleanfalseAdds .validate class to the Input componentvalidate=true
valueNumber, Boolean or StringThe value of the input element (use with the controlled input)value="I am controlled" onChange=this.handleChange
valueDefaultNumber or StringThe default value of the input (use with the uncontrolled input)valueDefault="I am uncontrolled"
arialLabelStringAdds custom aria-label text for input elementarialLabel="close"
materialBooleanfalseChanges component styles for material themematerial=true