Form
Import
import { Form } from "@dhua5922/react-native-kit";
Examples
Live Editor
function Example() { const [text, setText] = useState(""); const [submittedText, setSubmittedText] = useState(""); return ( <> <Form onSubmit={() => setSubmittedText(text)}> <Form.Label required>Input Label</Form.Label> <Form.Input placeholder="Enter text here" value={text} onChange={(text) => setText(text)} /> <Form.Button style={{ marginBottom: 10 }}>Submit</Form.Button> </Form> <Text>Submited Text: {submittedText}</Text> </> ); }
Result
Loading...
Props
| Name | Type | Default | Description |
|---|---|---|---|
onSubmit | () => void | Callback fired for handling form submission. |