React Form Input Component
Form control
React input components. Give textual form `<input>`s an upgrade with custom styles, sizing, focus states, validation, and more.
Other Frameworks
CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.
Example#
If you need to add custom classNames to form's components, or need to add some custom elements you can add each form component separately. Please check the example below.
<CForm><CFormLabelhtmlFor="exampleFormControlInput1">Email address</CFormLabel><CFormInputtype="email"id="exampleFormControlInput1"placeholder="[email protected]"aria-describedby="exampleFormControlInputHelpInline"/><CFormTextas="span"id="exampleFormControlInputHelpInline">Must be 8-20 characters long.</CFormText></CForm>
Sizing#
Set heights usingsize
property likesize="lg"
andsize="sm"
.
Disabled#
Add thedisabled
boolean attribute on an input to give it a grayed out appearance and remove pointer events.
Readonly#
Add thereadOnly
boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.
Readonly plain text#
If you want to have<input readonly>
elements in your form styled as plain text, use theplainText
boolean property to remove the default form field styling and preserve the correct margin and padding.
File input#
Color#
API#
Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.