Input
Last updated
Last updated
Input
widget in Supervisely allows to create input fields for text. It is a useful widget for applications that require users to enter text, such as project name, dataset name or path to folder or archive with data.
The Input
widget also allows you to set default text to be displayed in the input field, set text placeholder, set input field to be readonly
, and set a minimum and maximum length for the input.
value
str
Binding value
minlength
int
Minimum input text length
maxlength
int
Maximum input text length
placeholder
str
Placeholder of input
size
Literal["mini", "small", "large", None]
Size of input
readonly
bool
Same as readonly in native input
type
Literal["text", "password"]
Same as type in native input
icon
Literal["search", "edit"]
Set an icon to indicate input type
widget_id
str
ID of the widget
Binding value.
type: str
default value: ""
Minimum input text length.
type: int
default value: 0
Maximum input text length.
type: int
default value: 1000
Placeholder of input.
type: str
default value: ""
Size of input.
type: Literal["mini", "small", "large", None]
default value: None
Same as readonly in native input.
type: bool
default value: false
Same as type in native input.
type: Literal["text", "password"]
default value: None
Set an icon to indicate input type. Set to None
to disable icon.
type: Literal["search", "edit"]
default value: None
ID of the widget.
type: str
default value: None
is_readonly()
Return True
if input is readonly, else False
.
set_value(value: str)
Set input value.
get_value()
Get input value.
enable_readonly()
Enable input`s readonly property.
disable_readonly()
Disable input`s readonly property.
set_icon()
Set icon type: "edit" or "search".
@value_changed
Decorator functions is handled when input value is changed.
You can find this example in our Github repository:
ui-widgets-demos/input/001_input/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Input
widgetInput
widget values.Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.