<Input>
A headless Input component for ReactLynx. It provides primitives for text entry and keyboard awareness.
Input component that supports controlled, uncontrolled, and keyboard avoidance capabilities. Use <Input> for single-line input and <TextArea> for multi-line input.
Basic Usage
Use <Input> to render a single-line input field, and <TextArea> to render a multi-line text area.
Avoiding Keyboard Overlap
Prevent the on-screen keyboard from obscuring the input field by automatically adjusting the view when the keyboard appears
Structure
API
TextAreaProps
bouncesiOS
Bounce effect for iOS
classNameiOSAndroidHarmony
className
confirmTypeiOSAndroidHarmony
The type of confirm button
defaultValueiOSAndroidHarmony
The value of the input
idiOSAndroidHarmony
The id of the input
inputFilteriOSAndroidHarmony
Filter the input content and process it in the form of regular expressions
lineSpacingiOSAndroid
Line spacing
maxLengthiOSAndroidHarmony
Max input length
maxLinesiOSAndroidHarmony
Max input lines
onBluriOSAndroidHarmony
Blurred
onConfirmiOSAndroidHarmony
Confirm button clicked
onFocusiOSAndroidHarmony
Focused
onInputiOSAndroidHarmony
Input content changed
onSelectionChangeiOSAndroidHarmony
Input selection changed
placeholderiOSAndroidHarmony
Placeholder
readonlyiOSAndroidHarmony
Interaction enabled
ref
showSoftInputOnFocusiOSAndroidHarmony
Show soft input keyboard while focused
styleiOSAndroidHarmony
style
typeiOSAndroidHarmony
Input content type
valueiOSAndroidHarmony
The controlled value of the input
KeyboardAwareTriggerProps
childreniOSAndroidHarmony
Children
classNameiOSAndroidHarmony
className
offsetiOSAndroidHarmony
Additional Offset, in px
styleiOSAndroidHarmony
style
KeyboardAwareRootProps
androidStatusBarPlusBottomBarHeightAndroid
The height of the Android status bar and bottom navigation bar needs to be set. If your App has an immersive status bar, only the height of the bottom navigation bar needs to be passed in. In px.
childreniOSAndroidHarmony
Children
forceAttachiOSAndroidHarmony
Whether to force attach the root component
KeyboardAwareResponderProps
androidTouchSlopAndroid
Android touch recognition mode. When inside a component that supports 'paging' mode, 'paging' must be enabled.
asiOSAndroidHarmony
The type of the root component
bounceableiOSAndroid
Enable bouncing effect
bounceableOptionsiOSAndroid
Props for bouncing effect
childreniOSAndroid
Children in scroll-view.
classNameiOSAndroidHarmony
className
enableScrolliOSAndroidHarmony
Enable scroll interaction.
enableScrollMonitoriOSAndroidHarmony
Enable scroll monitor.
estimatedItemStyleiOSAndroid
Estimated height and width of the items need to be set.
exposureBottomiOSAndroid
exposure-screen-margin-bottom
exposureIDiOSAndroidHarmony
exposure-id for global exposure
exposureLeftiOSAndroid
exposure-screen-margin-left
exposureRightiOSAndroid
exposure-screen-margin-right
exposureSceneiOSAndroidHarmony
exposure-scene for global exposure
exposureTopiOSAndroid
exposure-screen-margin-top
firstScreenItemCountiOSAndroid
Estimated first screen item count for lazy rendering. Remaining children will complete rendering based on exposure. When this estimate is small, it may cause a blank screen phenomenon where some nodes exist on the first screen.
iOSBouncesiOSAndroid
Open the bouncing effect on iOS. If you want to use it on Android, please refer to the bounceableOption. If the bounceableOption is set, the iOSBounces property will be invalid.
lazyiOSAndroid
When enabled, only the items that are about to enter the viewport are rendered, reducing initial load time and memory usage; remaining items are rendered as they approach visibility during scroll.
lazyOptionsiOSAndroid
When enabled, only the items that are about to enter the viewport are rendered, reducing initial load time and memory usage; remaining items are rendered as they approach visibility during scroll.
main-thread:gestureiOSAndroid
If you want to use gesture, pass it here.
onUIAppeariOSAndroidHarmony
Exposure event for UI
onUIDisappeariOSAndroidHarmony
Disappear event for UI
ref
sceneiOSAndroid
Be used to mark the exposure timing of lazy loading. Please ensure that it is unique throughout the page.
scrollMonitorTagiOSAndroidHarmony
The tag for scroll monitor.
scrollOrientationiOSAndroidHarmony
Set to 'vertical' for vertical scrolling and set to 'horizontal' for horizontal scrolling.
scrollPropagationBehavioriOSAndroid
Controls whether scroll events propagate to parent containers. For now, 'preventPropagate' needs to be used together with temporaryBlockScrollClass and temporaryBlockScrollTag on iOS.
scrollviewIdiOSAndroid
The id of the scrollview.
stickyiOSAndroid
Sticky item, designed for
Tabs.styleiOSAndroid
Styles for
KeyboardAwareResponder
KeyboardAwareResponder 的样式temporaryBlockScrollClassiOS
The specific class name of the container that is blocked when 'scrollPropagationBehavior' is set to be 'preventPropagate', must be informed by the container provider. For now, 'preventPropagate' needs to be used together with temporaryBlockScrollClass and temporaryBlockScrollTag on iOS.
temporaryBlockScrollTagiOS
Used to specify the native container tag that is blocked when 'scrollPropagationBehavior' is set to be 'preventPropagate', corresponding to the Tag attribute of UIView. Needs to be specified by the native container provider. For now, 'preventPropagate' needs to be used together with temporaryBlockScrollClass and temporaryBlockScrollTag on iOS.
temporaryNestedScrollAndroid
Android-only temporary flag to control nested scroll; maps to native 'enable-nested-scroll'. Android default value is true.
testingiOSAndroid
Testing Mode.
catchLongPressiOSAndroidHarmony
Same as onLongPress, but stops the event from propagating to parent elements.
catchTouchCanceliOSAndroidHarmony
Same as onTouchCancel, but stops the event from propagating to parent elements.
catchTouchEndiOSAndroidHarmony
Same as onTouchEnd, but stops the event from propagating to parent elements.
catchTouchMoveiOSAndroidHarmony
Same as onTouchMove, but stops the event from propagating to parent elements.
catchTouchStartiOSAndroidHarmony
Same as onTouchStart, but stops the event from propagating to parent elements.
onContentSizeChangeiOSAndroid
Being triggered when scrolling content changes.
onLayoutChangeiOSAndroidHarmony
Send when UI has changed viewport size.
onLongPressiOSAndroidHarmony
Send when a touch-point is held on the UI for a period of time.
onScrolliOSAndroid
Being triggered when scrolling occurs.
onScrollEndiOSAndroid
Being triggered when scrolling stops.
onScrollToLoweriOSAndroid
Being triggered when scrolling to lower.
onScrollToUpperiOSAndroid
Being triggered when scrolling to upper.
onTapiOSAndroidHarmony
Send when a touch-point is tapped on the UI.
onTouchCanceliOSAndroidHarmony
Send when a touch event is interrupted or cancelled before it is completed.
onTouchEndiOSAndroidHarmony
Send when a touch-point is removed from the UI.
onTouchMoveiOSAndroidHarmony
Send when a touch-point is moving on the UI.
onTouchStartiOSAndroidHarmony
Send when a touch-point is placed on the UI.
InputProps
classNameiOSAndroidHarmony
className
confirmTypeiOSAndroidHarmony
The type of confirm button
defaultValueiOSAndroidHarmony
The value of the input
idiOSAndroidHarmony
The id of the input
inputFilteriOSAndroidHarmony
Filter the input content and process it in the form of regular expressions
maxLengthiOSAndroidHarmony
Max input length
onBluriOSAndroidHarmony
Blurred
onConfirmiOSAndroidHarmony
Confirm button clicked
onFocusiOSAndroidHarmony
Focused
onInputiOSAndroidHarmony
Input content changed
onSelectionChangeiOSAndroidHarmony
Input selection changed
placeholderiOSAndroidHarmony
Placeholder
readonlyiOSAndroidHarmony
Interaction enabled
ref
showSoftInputOnFocusiOSAndroidHarmony
Show soft input keyboard while focused
styleiOSAndroidHarmony
style
typeiOSAndroidHarmony
Input content type
valueiOSAndroidHarmony
The controlled value of the input
TextAreaRef
bluriOSAndroidHarmony
Release focus
focusiOSAndroidHarmony
Require focus
getValueiOSAndroidHarmony
Get input content
setSelectionRangeiOSAndroidHarmony
Set selection range
setValueiOSAndroidHarmony
Set input content
KeyboardAwareResponderRef
as
InputRef
bluriOSAndroidHarmony
Release focus
focusiOSAndroidHarmony
Require focus
getValueiOSAndroidHarmony
Get input content
setSelectionRangeiOSAndroidHarmony
Set selection range
setValueiOSAndroidHarmony
Set input content