- Wrap a pair of <CFormControl> and <CFormLabel>{' '}
+ Wrap a pair of <CFormInput> and <CFormLabel>{' '}
elements in CFormFloating to enable floating labels with textual form
- fields. A placeholder is required on each{' '}
- <CFormControl> as our method of CSS-only floating labels uses the{' '}
- :placeholder-shown pseudo-element. Also note that the{' '}
- <CFormControl> must come first so we can utilize a sibling selector
- (e.g., ~).
+ fields. A placeholder is required on each <CFormInput>{' '}
+ as our method of CSS-only floating labels uses the :placeholder-shown{' '}
+ pseudo-element. Also note that the <CFormInput> must come first so
+ we can utilize a sibling selector (e.g., ~).
-
+ Email address
-
- Password
+
+ Password
@@ -49,7 +49,7 @@ const FloatingLabels = () => {
- {
- By default, <CFormControl component="textarea">s will be
- the same height as <CFormControl>s.
+ By default, <CFormTextarea>s will be the same height as{' '}
+ <CFormInput>s.
-
+ >
Comments
- To set a custom height on your{' '}
- <CFormControl component="textarea">, do not use the{' '}
+ To set a custom height on your <CFormTextarea;>, do not use the{' '}
rows attribute. Instead, set an explicit height (either
inline or via custom CSS).
- Other than <CFormControl>, floating labels are only available on{' '}
+ Other than <CFormInput>, floating labels are only available on{' '}
<CFormSelect>s. They work in the same way, but unlike{' '}
- <CFormControl>s, they'll always show the{' '}
+ <CFormInput>s, they'll always show the{' '}
<CFormLabel> in its floated state.{' '}
Selects with size and multiple are not supported.
@@ -144,7 +141,7 @@ const FloatingLabels = () => {
- {
Email address
- {
Example textarea
-
+
@@ -58,20 +55,20 @@ const FormControl = () => {
size="sm".
-
-
- {
appearance and remove pointer events.
-
- {
but retain the standard cursor.
- {
Email
@@ -237,7 +234,7 @@ const FormControl = () => {
Color picker
- {
@
-
- {
Your vanity URLhttps://example.com/users/
-
+ $
-
+ .00
-
+ @
-
+ With textarea
-
+
@@ -91,7 +92,7 @@ const Select = () => {
@
- {
Small
- Default
- Large
-
@@ -159,7 +160,7 @@ const Select = () => {
aria-label="Checkbox for following text input"
/>
-
+
@@ -169,7 +170,7 @@ const Select = () => {
aria-label="Radio button for following text input"
/>
-
+
@@ -182,15 +183,15 @@ const Select = () => {
- While multiple <CFormControl>s are supported visually, validation
+ While multiple <CFormInput>s are supported visually, validation
styles are only available for input groups with a single{' '}
- <CFormControl>.
+ <CFormInput>.