Skip to content

TextInput example

TextInput is controlled through a value prop and a text-change event. The controlled write handshake is shared; the public event name is framework-shaped.

import './NameInput.css';
import { useState } from 'react';
import { Text, TextInput, View } from '@symbiote-native/react';
export function NameInput() {
const [name, setName] = useState('Symbiote');
return (
<View className="root">
<TextInput value={name} onValueChange={setName} className="input" />
<Text>Hello, {name}</Text>
</View>
);
}
NameInput.css
.root { gap: 12px; }
.input { min-width: 220px; padding: 12px; border-width: 1px; }
Concern React Vue Angular Svelte
Text prop value :value
or v-model
[value]
or [(value)]
value
Text change onValueChange(text, event) @value-change
or v-model
(valueChange)="handler($event)" (text only) onValueChange={(text, event) => …}
Native event (same callback, 2nd arg) (same emit, 2nd arg) (change)="handler($event)" (separate output) (same callback, 2nd arg)
Imperative handle React ref Vue template ref / exposed handle @ViewChild(TextInput) (the component IS the handle) bind:this (a ShimElement) via hostInstance()

StyleSheet.create works identically to a CSS class if you’d rather keep style objects inline — see the Styling guide.