You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/library/forms/input.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,35 @@ def controlled_example():
68
68
69
69
Behind the scenes, the input component is implemented as a debounced input to avoid sending individual state updates per character to the backend while the user is still typing. This allows a state variable to directly control the `value` prop from the backend without the user experiencing input lag.
70
70
71
-
### Submitting a form using input
71
+
## Input Types
72
+
73
+
The `type` prop controls how the input is rendered (e.g. plain text, password, file picker).
74
+
75
+
It accepts the same values as the native HTML `<input type>` attribute, such as:
76
+
77
+
-`"text"` (default)
78
+
-`"password"`
79
+
-`"email"`
80
+
-`"number"`
81
+
-`"file"`
82
+
-`"checkbox"`
83
+
-`"radio"`
84
+
-`"date"`
85
+
-`"time"`
86
+
-`"url"`
87
+
-`"color"`
88
+
89
+
and several others. See the [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) for the full list.
The `name` prop is needed to submit with its owning form as part of a name/value pair.
74
102
@@ -118,7 +146,7 @@ def form_input1():
118
146
119
147
To learn more about how to use forms in the [Form]({library.forms.form.path}) docs.
120
148
121
-
###Setting a value without using a State var
149
+
## Setting a value without using a State var
122
150
123
151
Set the value of the specified reference element, without needing to link it up to a State var. This is an alternate way to modify the value of the `input`.
0 commit comments