@@ -4,10 +4,11 @@ import {
44 CCardBody ,
55 CCardHeader ,
66 CCol ,
7- CFormControl ,
7+ CFormInput ,
88 CFormLabel ,
99 CFormFloating ,
1010 CFormSelect ,
11+ CFormTextarea ,
1112 CRow ,
1213} from '@coreui/react'
1314import { DocsCallout , Example } from 'src/reusable'
@@ -25,22 +26,21 @@ const FloatingLabels = () => {
2526 </ CCardHeader >
2627 < CCardBody >
2728 < p className = "text-medium-emphasis small" >
28- Wrap a pair of < code > <CFormControl ></ code > and < code > <CFormLabel></ code > { ' ' }
29+ Wrap a pair of < code > <CFormInput ></ code > and < code > <CFormLabel></ code > { ' ' }
2930 elements in < code > CFormFloating</ code > to enable floating labels with textual form
30- fields. A < code > placeholder</ code > is required on each{ ' ' }
31- < code > <CFormControl></ code > as our method of CSS-only floating labels uses the{ ' ' }
32- < code > :placeholder-shown</ code > pseudo-element. Also note that the{ ' ' }
33- < code > <CFormControl></ code > must come first so we can utilize a sibling selector
34- (e.g., < code > ~</ code > ).
31+ fields. A < code > placeholder</ code > is required on each < code > <CFormInput></ code > { ' ' }
32+ as our method of CSS-only floating labels uses the < code > :placeholder-shown</ code > { ' ' }
33+ pseudo-element. Also note that the < code > <CFormInput></ code > must come first so
34+ we can utilize a sibling selector (e.g., < code > ~</ code > ).
3535 </ p >
3636 < Example href = "forms/floating-labels" >
3737 < CFormFloating className = "mb-3" >
38- < CFormControl type = "email" id = "floatingInput" placeholder = "name@example.com" />
38+ < CFormInput type = "email" id = "floatingInput" placeholder = "name@example.com" />
3939 < CFormLabel htmlFor = "floatingInput" > Email address</ CFormLabel >
4040 </ CFormFloating >
4141 < CFormFloating >
42- < CFormControl type = "password" id = "floatingPassword" placeholder = "Password" />
43- < CFormLabel htmlFor = "exampleFormControlTextarea1 " > Password</ CFormLabel >
42+ < CFormInput type = "password" id = "floatingPassword" placeholder = "Password" />
43+ < CFormLabel htmlFor = "floatingPassword " > Password</ CFormLabel >
4444 </ CFormFloating >
4545 </ Example >
4646 < p className = "text-medium-emphasis small" >
@@ -49,7 +49,7 @@ const FloatingLabels = () => {
4949 </ p >
5050 < Example href = "forms/floating-labels" >
5151 < CFormFloating >
52- < CFormControl
52+ < CFormInput
5353 type = "email"
5454 id = "floatingInputValue"
5555 placeholder = "name@example.com"
@@ -68,33 +68,30 @@ const FloatingLabels = () => {
6868 </ CCardHeader >
6969 < CCardBody >
7070 < p className = "text-medium-emphasis small" >
71- By default, < code > <CFormControl component="textarea"& gt;</ code > s will be
72- the same height as < code > <CFormControl ></ code > s.
71+ By default, < code > <CFormTextarea& gt;</ code > s will be the same height as { ' ' }
72+ < code > <CFormInput ></ code > s.
7373 </ p >
7474 < Example href = "forms/floating-labels#textareas" >
7575 < CFormFloating >
76- < CFormControl
77- component = "textarea"
76+ < CFormTextarea
7877 id = "floatingTextarea"
7978 placeholder = "Leave a comment here"
80- > </ CFormControl >
79+ > </ CFormTextarea >
8180 < CFormLabel htmlFor = "floatingTextarea" > Comments</ CFormLabel >
8281 </ CFormFloating >
8382 </ Example >
8483 < p className = "text-medium-emphasis small" >
85- To set a custom height on your{ ' ' }
86- < code > <CFormControl component="textarea"></ code > , do not use the{ ' ' }
84+ To set a custom height on your < code > <CFormTextarea;></ code > , do not use the{ ' ' }
8785 < code > rows</ code > attribute. Instead, set an explicit < code > height</ code > (either
8886 inline or via custom CSS).
8987 </ p >
9088 < Example href = "forms/floating-labels#textareas" >
9189 < CFormFloating >
92- < CFormControl
93- component = "textarea"
90+ < CFormTextarea
9491 placeholder = "Leave a comment here"
9592 id = "floatingTextarea2"
9693 style = { { height : '100px' } }
97- > </ CFormControl >
94+ > </ CFormTextarea >
9895 < CFormLabel htmlFor = "floatingTextarea2" > Comments</ CFormLabel >
9996 </ CFormFloating >
10097 </ Example >
@@ -108,9 +105,9 @@ const FloatingLabels = () => {
108105 </ CCardHeader >
109106 < CCardBody >
110107 < p className = "text-medium-emphasis small" >
111- Other than < code > <CFormControl ></ code > , floating labels are only available on{ ' ' }
108+ Other than < code > <CFormInput ></ code > , floating labels are only available on{ ' ' }
112109 < code > <CFormSelect></ code > s. They work in the same way, but unlike{ ' ' }
113- < code > <CFormControl ></ code > s, they'll always show the{ ' ' }
110+ < code > <CFormInput ></ code > s, they'll always show the{ ' ' }
114111 < code > <CFormLabel></ code > in its floated state.{ ' ' }
115112 < strong >
116113 Selects with < code > size</ code > and < code > multiple</ code > are not supported.
@@ -144,7 +141,7 @@ const FloatingLabels = () => {
144141 < CRow xs = { { gutter : 2 } } >
145142 < CCol md >
146143 < CFormFloating >
147- < CFormControl
144+ < CFormInput
148145 type = "email"
149146 id = "floatingInputGrid"
150147 placeholder = "name@example.com"
0 commit comments