TouchableWithoutFeedback
Do not use unless you have a very good reason. All elements that respond to press should have a visual feedback when touched.
TouchableWithoutFeedback
supports only one child. If you wish to have several child components, wrap them in a View. Importantly, TouchableWithoutFeedback
works by cloning its child and applying responder props to it. It is therefore required that any intermediary components pass through those props to the underlying React Native component.
Usage Pattern
function MyComponent(props: MyComponentProps) {
return (
<View {...props} style={{flex: 1, backgroundColor: '#fff'}}>
<Text>My Component</Text>
</View>
);
}
<TouchableWithoutFeedback onPress={() => alert('Pressed!')}>
<MyComponent />
</TouchableWithoutFeedback>;
Example
import React, {useState} from 'react';
import {StyleSheet, TouchableWithoutFeedback, Text, View} from 'react-native';
const TouchableWithoutFeedbackExample = () => {
const [count, setCount] = useState(0);
const onPress = () => {
setCount(count + 1);
};
return (
<View style={styles.container}>
<View style={styles.countContainer}>
<Text style={styles.countText}>Count: {count}</Text>
</View>
<TouchableWithoutFeedback onPress={onPress}>
<View style={styles.button}>
<Text>Touch Here</Text>
</View>
</TouchableWithoutFeedback>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
paddingHorizontal: 10,
},
button: {
alignItems: 'center',
backgroundColor: '#DDDDDD',
padding: 10,
},
countContainer: {
alignItems: 'center',
padding: 10,
},
countText: {
color: '#FF00FF',
},
});
export default TouchableWithoutFeedbackExample;
Reference
Props
accessible
When true
, indicates that the view is an accessibility element. By default, all the touchable elements are accessible.
Type |
---|
bool |
accessibilityLabel
Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text
nodes separated by space.
Type |
---|
string |
accessibilityHint
An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.
Type |
---|
string |
accessibilityRole
accessibilityRole
communicates the purpose of a component to the user of an assistive technology.
accessibilityRole
can be one of the following:
'none'
- Used when the element has no role.'button'
- Used when the element should be treated as a button.'link'
- Used when the element should be treated as a link.'search'
- Used when the text field element should also be treated as a search field.'image'
- Used when the element should be treated as an image. Can be combined with button or link, for example.'keyboardkey'
- Used when the element acts as a keyboard key.'text'
- Used when the element should be treated as static text that cannot change.'adjustable'
- Used when an element can be "adjusted" (e.g. a slider).'imagebutton'
- Used when the element should be treated as a button and is also an image.'header'
- Used when an element acts as a header for a content section (e.g. the title of a navigation bar).'summary'
- Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.'alert'
- Used when an element contains important text to be presented to the user.'checkbox'
- Used when an element represents a checkbox which can be checked, unchecked, or have mixed checked state.'combobox'
- Used when an element represents a combo box, which allows the user to select among several choices.'menu'
- Used when the component is a menu of choices.'menubar'
- Used when a component is a container of multiple menus.'menuitem'
- Used to represent an item within a menu.'progressbar'
- Used to represent a component which indicates progress of a task.'radio'
- Used to represent a radio button.'radiogroup'
- Used to represent a group of radio buttons.'scrollbar'
- Used to represent a scroll bar.'spinbutton'
- Used to represent a button which opens a list of choices.'switch'
- Used to represent a switch which can be turned on and off.'tab'
- Used to represent a tab.'tablist'
- Used to represent a list of tabs.'timer'
- Used to represent a timer.'toolbar'
- Used to represent a tool bar (a container of action buttons or components).
Type |
---|
string |
accessibilityState
Describes the current state of a component to the user of an assistive technology.
See the Accessibility guide for more information.
Type |
---|
object: {disabled: bool, selected: bool, checked: bool or 'mixed', busy: bool, expanded: bool} |
accessibilityActions
Accessibility actions allow an assistive technology to programmatically invoke the actions of a component. The accessibilityActions
property should contain a list of action objects. Each action object should contain the field name and label.
See the Accessibility guide for more information.
Type |
---|
array |
aria-busy
Indicates an element is being modified. Assistive technologies may want to wait until the changes are complete before informing the user about the update.
Type | Default |
---|---|
boolean | false |
aria-checked
Indicates the state of a checkable element. This field can either take a boolean or the "mixed" string to represent mixed checkboxes.
Type | Default |
---|---|
boolean, 'mixed' | false |
aria-disabled
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
Type | Default |
---|---|
boolean | false |
aria-expanded
Indicates whether an expandable element is currently expanded or collapsed.
Type | Default |
---|---|
boolean | false |
aria-hidden
Indicates whether the accessibility elements contained within this accessibility element are hidden.
For example, in a window that contains sibling views A
and B
, setting aria-hidden
to true
on view B
causes VoiceOver to ignore the elements in the view B
.
Type | Default |
---|---|
boolean | false |
ariaLabel
Obsolete. Use aria-label
instead.
The value for ariaLabel
refers to the name of the item, such as "Alexa, select Prime Video".
This prop is required if the app wants to allow user to perform voice selection based on the name.
Note: Providing the prop with a value does not result in the value being rendered as the title of the component, the app must explictly render the same text value for the item.
Type |
---|
string |
aria-label
aria-label
is an accessibility prop. You can use it to specify the name of the item in voice selection, such as "Alexa, select Prime Video".
This prop is required if the app needs to allow the user to perform voice selection based on the name.
Note: Providing the prop with a value does not result in the value being rendered as the title of the component, the app must explictly render the same text value for the item.
Type |
---|
string |
aria-labelledby
Identifies the element that labels the element it is applied to. Note: If the value of aria-labelledby
doesn't match the nativeID
value of the related element the element won't be labled.
<View>
<Text nativeID="formLabel">Label for Input Field</Text>
<TextInput aria-label="input" aria-labelledby="formLabel" />
</View>
Type |
---|
string |
aria-live
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
- off Accessibility services should not announce changes to this view.
- polite Accessibility services should announce changes to this view.
- assertive Accessibility services should interrupt ongoing speech to immediately announce changes to this view.
Type | Default |
---|---|
enum('assertive' , 'off' , 'polite' ) |
'off' |
aria-selected
Indicates whether a selectable element is currently selected or not.
Type |
---|
boolean |
onAccessibilityAction
Invoked when the user performs the accessibility actions. The only argument to this function is an event containing the name of the action to perform.
See the Accessibility guide for more information.
Type |
---|
function |
accessibilityValue
Represents the current value of a component. It can be a textual description of a component's value, or for range-based components, such as sliders and progress bars, it contains range information (minimum, current, and maximum).
See the Accessibility guide for more information.
Type |
---|
object: {min: number, max: number, now: number, text: string} |
aria-valuemax
Represents the maximum value for range-based components, such as sliders and progress bars. Has precedence over the max
value in the accessibilityValue
prop.
Type |
---|
number |
aria-valuemin
Represents the minimum value for range-based components, such as sliders and progress bars. Has precedence over the min
value in the accessibilityValue
prop.
Type |
---|
number |
aria-valuenow
Represents the current value for range-based components, such as sliders and progress bars. Has precedence over the now
value in the accessibilityValue
prop.
Type |
---|
number |
aria-valuetext
Represents the textual description of the component. Has precedence over the text
value in the accessibilityValue
prop.
Type |
---|
string |
accessibilityDescribedByKepler
This property receives a list of nativeID
of elements which describe this element. In the context of TV you can use it to link an individual content tile with the details view or other on-screen elements which describe it. As with label relationships, description relationships should be reciprocal. If element A is describedBy
elements B and C, then elements B and C should also be a descriptionFor
element A.
Type | Required |
---|---|
array | No |
accessibilityOrientationTextKepler
This optional string property describes how a user should interact with content inside this pane. It should only be included when the understanding of the visual layout of content is essential to navigating it successfully.
Type | Required |
---|---|
string | No |
disabled
If true, disable all interactions for this component.
Type |
---|
bool |
hitSlop
This defines how far your touch can start away from the button. This is added to pressRetentionOffset
when moving off of the button.
The touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.
Type |
---|
Rect or number |
id
Used to locate this view from native code. Has precedence over nativeID
prop.
Type |
---|
string |
onBlur
Invoked when the item loses focus.
Type |
---|
function |
onFocus
Invoked when the item receives focus.
Type |
---|
function |
enableSynchronousFocusEventsKepler
When set to true
, onFocus
and onBlur
events are dispatched synchronously. UI Thread will be blocked until the execution of onFocus
or onBlur
from JavaScript has completed.
Type | Required | Platform |
---|---|---|
bool | No | Kepler |
onLayout
Invoked on mount and on layout changes.
Type |
---|
({nativeEvent: [LayoutEvent](layoutevent)}) => void |
nativeID
Type |
---|
string |
testID
Used to locate this view in end-to-end tests.
Type |
---|
string |
alexaEntityType - Kepler Only
alexaEntityType
represents the value for the type of object that needs to be considered by Alexa UIController Interface. This is an optional prop and specific to Alexa UIController Interface support, it maps to the entity.type
field from the Alexa UIController Interface (Alexa UIController API doc)
Type |
---|
enum('Thing', 'VideoObject', 'ItemList', 'SoftwareApplication') |
alexaExternalIds - Kepler Only
This is an optional prop and specific to Alexa UIController Interface support, it maps to the entity.ExternalIds
field from the Alexa UIController Interface (Alexa UIController API doc)
entity.ExternalIds
are the identifiers for this entity unique within the scope of this endpoint. The entity.externalIds
field are opaque to Alexa and are only used to include in directives from Alexa. The identifiers reported in entity.externalIds
are required to be understood by the endpoint on all directive commands that accept an entity structure.
Type |
---|
object: {key: "string", value: "string"} |
ariaPosInSet
The value for ariaPosInSet
refers to the number of the element when the user can refer to the element by number, such as "Alexa, select number one."
This prop is required if the app wants to allow user to perform voice selection based on the number.
Note that providing the prop with a value does not result in the value being rendered automatically from the component, for a consistent user behavior, app needs to render the same ordinal value for the item.
Type |
---|
number |
keplerAltLabels - Kepler Only
The value for keplerAltLabels
refers to the list of alternate names for the item.
Note: This property replaces keplerAtlLabels
. keplerAtlLabels
is deprecated and will be removed in a future release.
This prop is required if the app wants to allow user to perform voice selection on the same item with different names.
Type |
---|
Array of string |
Last updated: Sep 30, 2025