Answer.Input
The Answer.Input component renders React Native's TextInput with the
react-native-paper TextInputProps type and SDK placeholder styling.
Basic Example
import { Answer } from "@ovok/native";
import * as React from "react";
const BasicAnswerInput = () => (
<Answer.Input placeholder="Enter your response" />
);
export default BasicAnswerInput;
Props
The public type is TextInputProps from react-native-paper, but the rendered
primitive is React Native's TextInput, not Paper's outlined/flat component. Native
text-input props are forwarded; Paper-only visual props such as mode, label,
left, right, and error do not add Paper behavior at runtime.
Primary Props
| Prop | Type | Default | Description |
|---|---|---|---|
style | StyleProp<TextStyle> | undefined | Additional styles to apply to the input field |
placeholderTextColor | string | theme.colors.onSurfaceDisabled | Color for placeholder text (automatically themed) |
Inherited Props
The type includes the following common input props:
valueonChangeTextplaceholdermultilinenumberOfLinesautoFocuskeyboardTypeautoCapitalizemaxLengtheditable
Component Behavior
Theme Integration
- Placeholder Color: Automatically uses
theme.colors.onSurfaceDisabledfor consistent muted text - Text Color: Uses the platform input's inherited text color unless the app supplies one
- Background: Uses the platform input's default background unless styled by the app
Styling
Default Styles
const styles = StyleSheet.create({
input: {
flex: 1,
},
});
Theme Colors Used
theme.colors.onSurfaceDisabled- Placeholder text color
Related Components
- Answer - Parent container component
- Answer.Header - Header navigation component
- Answer.Question - Question display component
- Answer.Actions - Bottom action container