-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext_input_echo.js
More file actions
50 lines (47 loc) · 1.14 KB
/
text_input_echo.js
File metadata and controls
50 lines (47 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
let value = '';
function handleChange(nextValue) {
value = nextValue;
App.requestRender();
}
function AppLayout() {
return View({
style: {
direction: 'column',
padding: 20,
spacing: 12
},
children: [
Text({
text: 'TextInput Example',
style: {
fontSize: 24,
color: '#111111'
}
}),
TextInput({
value,
placeholder: 'Type something',
onChange: handleChange,
style: {
width: 320,
padding: 10,
borderWidth: 1,
borderRadius: 8,
borderColor: '#C7CDD4'
}
}),
Text({
text: `Current value: ${value}`,
style: {
fontSize: 18,
color: '#333333'
}
})
]
});
}
App.run({
title: 'TextInput Example',
windowSize: { width: 520, height: 260 },
render: AppLayout
});