@@ -14,7 +14,7 @@ TextInput is a form component to add default styling to the native text input.
14
14
< TextInput aria- label= " Zipcode" name= " zipcode" placeholder= " Zipcode" autoComplete= " postal-code" / >
15
15
```
16
16
17
- ## Text Input with Icons
17
+ ## Text Input with icons
18
18
19
19
``` jsx live
20
20
<>
@@ -27,7 +27,6 @@ TextInput is a form component to add default styling to the native text input.
27
27
/ >
28
28
29
29
< TextInput
30
- sx= {{mt: 3 }}
31
30
trailingVisual= {SearchIcon}
32
31
aria- label= " Zipcode"
33
32
name= " zipcode"
@@ -37,23 +36,17 @@ TextInput is a form component to add default styling to the native text input.
37
36
< / >
38
37
```
39
38
40
- ## Text Input with Text visuals
39
+ ## Text Input with text visuals
41
40
42
41
``` jsx live
43
42
<>
44
43
< TextInput leadingVisual= " $" aria- label= " Cost of the thing" name= " cost" placeholder= " 23.45" / >
45
44
46
- < TextInput
47
- sx= {{mt: 3 , width: ' 150px' }}
48
- trailingVisual= " minutes"
49
- aria- label= " Time in minutes"
50
- name= " time"
51
- placeholder= " 25"
52
- / >
45
+ < TextInput sx= {{width: ' 150px' }} trailingVisual= " minutes" aria- label= " Time in minutes" name= " time" placeholder= " 25" / >
53
46
< / >
54
47
```
55
48
56
- ## Text Input with Error and warning states
49
+ ## Text Input with error and warning states
57
50
58
51
``` jsx live
59
52
<>
@@ -66,7 +59,6 @@ TextInput is a form component to add default styling to the native text input.
66
59
/ >
67
60
68
61
< TextInput
69
- sx= {{mt: 3 }}
70
62
validationStatus= " warning"
71
63
aria- label= " Zipcode"
72
64
name= " zipcode"
@@ -86,6 +78,7 @@ TextInput is a form component to add default styling to the native text input.
86
78
87
79
``` jsx live
88
80
< TextInput contrast aria- label= " Zipcode" name= " zipcode" placeholder= " Find user" autoComplete= " postal-code" / >
81
+ ```
89
82
90
83
## Props
91
84
@@ -99,7 +92,7 @@ TextInput is a form component to add default styling to the native text input.
99
92
defaultValue = " false"
100
93
description = {
101
94
<>
102
- Adds < InlineCode > display : block < / InlineCode > to element
95
+ Creates a full width input element
103
96
</>
104
97
}
105
98
/>
@@ -109,19 +102,36 @@ TextInput is a form component to add default styling to the native text input.
109
102
defaultValue = " false"
110
103
description = " Changes background color to a higher contrast color"
111
104
/>
112
- < PropsTableRow
113
- name= " variant"
114
- type= " 'small' | 'large'"
115
- description= " Creates a smaller or larger input than the default."
116
- / >
105
+ <PropsTableRow name = ' size' type = " 'small' | 'medium' | 'large'" description = " Creates a smaller or larger input than the default." />
106
+
107
+ <PropsTableRow
108
+ name = " leadingVisual"
109
+ type = { <>string | React.ComponentType</>}
110
+ description = " Visual positioned on the left edge inside the input"
111
+ />
112
+ <PropsTableRow
113
+ name = " trailingVisual"
114
+ type = { <>string | React.ComponentType</>}
115
+ description = " Visual positioned on the right edge inside the input"
116
+ />
117
+ <PropsTableRow name = " validationStatus" type = " 'warning' | 'error'" description = " Style the input to match the status" />
118
+
119
+ <PropsTableRow
120
+ name = " variant"
121
+ type = " 'small' | 'medium' | 'large'"
122
+ description = " (Use size) Creates a smaller or larger input than the default."
123
+ deprecated
124
+ />
125
+
117
126
<PropsTableRow
118
127
name = " width"
119
128
type = {
120
129
<>
121
130
string | number | <Link href = " https://styled-system.com/guides/array-props" >Array< string | number> </Link >
122
131
</>
123
132
}
124
- description= " Set the width of the input"
133
+ description = " (Use sx prop) Set the width of the input"
134
+ deprecated
125
135
/>
126
136
<PropsTableRow
127
137
name = " maxWidth"
@@ -130,7 +140,8 @@ TextInput is a form component to add default styling to the native text input.
130
140
string | number | <Link href = " https://styled-system.com/guides/array-props" >Array< string | number> </Link >
131
141
</>
132
142
}
133
- description= " Set the maximum width of the input"
143
+ description = " (Use sx prop) Set the maximum width of the input"
144
+ deprecated
134
145
/>
135
146
<PropsTableRow
136
147
name = " minWidth"
@@ -139,12 +150,14 @@ TextInput is a form component to add default styling to the native text input.
139
150
string | number | <Link href = " https://styled-system.com/guides/array-props" >Array< string | number> </Link >
140
151
</>
141
152
}
142
- description= " Set the minimum width of the input"
153
+ description = " (Use sx prop) Set the minimum width of the input"
154
+ deprecated
143
155
/>
144
156
<PropsTableRow
145
157
name = " icon"
146
158
type = " React.ComponentType"
147
- description= " An Octicon React component. To be used inside of input. Positioned on the left edge."
159
+ description = " (Use leadingVisual or trailingVisual) An Octicon React component. To be used inside of input. Positioned on the left edge."
160
+ deprecated
148
161
/>
149
162
<PropsTableSxRow />
150
163
<PropsTableRefRow
@@ -170,8 +183,8 @@ TextInput is a form component to add default styling to the native text input.
170
183
adaptsToScreenSizes: true ,
171
184
fullTestCoverage: false ,
172
185
usedInProduction: true ,
173
- usageExamplesDocumented: false ,
174
- hasStorybookStories: false ,
186
+ usageExamplesDocumented: true ,
187
+ hasStorybookStories: true ,
175
188
designReviewed: false ,
176
189
a11yReviewed: false ,
177
190
stableApi: false ,
@@ -180,4 +193,3 @@ TextInput is a form component to add default styling to the native text input.
180
193
hasFigmaComponent: false
181
194
}}
182
195
/>
183
- ```
0 commit comments