Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • TouchableOpacityProps
    • IAmplifyButtonProps

Index

Properties

Optional accessibilityActions

accessibilityActions: ReadonlyArray<AccessibilityActionInfo>

Provides an array of custom actions available for accessibility.

Optional accessibilityComponentType

accessibilityComponentType: "none" | "button" | "radiobutton_checked" | "radiobutton_unchecked"

In some cases, we also want to alert the end user of the type of selected component (i.e., that it is a “button”). If we were using native buttons, this would work automatically. Since we are using javascript, we need to provide a bit more context for TalkBack. To do so, you must specify the ‘accessibilityComponentType’ property for any UI component. For instances, we support ‘button’, ‘radiobutton_checked’ and ‘radiobutton_unchecked’ and so on.

platform

android

Optional accessibilityElementsHidden

accessibilityElementsHidden: boolean

A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden to the screen reader.

platform

ios

Optional accessibilityHint

accessibilityHint: string

An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.

Optional accessibilityIgnoresInvertColors

accessibilityIgnoresInvertColors: boolean

Optional accessibilityLabel

accessibilityLabel: string

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.

Optional accessibilityLiveRegion

accessibilityLiveRegion: "none" | "polite" | "assertive"

Indicates to accessibility services whether the user should be notified when this view changes. Works for Android API >= 19 only. See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion for references.

platform

android

Optional accessibilityRole

accessibilityRole: AccessibilityRole

Accessibility Role tells a person using either VoiceOver on iOS or TalkBack on Android the type of element that is focused on.

Optional accessibilityState

accessibilityState: AccessibilityState

Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on.

Optional accessibilityTraits

accessibilityTraits: AccessibilityTrait | AccessibilityTrait[]

Accessibility traits tell a person using VoiceOver what kind of element they have selected. Is this element a label? A button? A header? These questions are answered by accessibilityTraits.

platform

ios

Optional accessibilityValue

accessibilityValue: 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).

Optional accessibilityViewIsModal

accessibilityViewIsModal: boolean

A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.

platform

ios

Optional accessible

accessible: boolean

When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible.

Optional activeOpacity

activeOpacity: number

Determines what the opacity of the wrapped view should be when touch is active. Defaults to 0.2

Optional delayLongPress

delayLongPress: number

Delay in ms, from onPressIn, before onLongPress is called.

Optional delayPressIn

delayPressIn: number

Delay in ms, from the start of the touch, before onPressIn is called.

Optional delayPressOut

delayPressOut: number

Delay in ms, from the release of the touch, before onPressOut is called.

Optional disabled

disabled: boolean

Optional hasTVPreferredFocus

hasTVPreferredFocus: boolean

(Apple TV only) TV preferred focus (see documentation for the View component).

platform

ios

Optional hitSlop

hitSlop: Insets

This defines how far your touch can start away from the button. This is added to pressRetentionOffset when moving off of the button. NOTE 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.

Optional importantForAccessibility

importantForAccessibility: "auto" | "yes" | "no" | "no-hide-descendants"

Controls how view is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references.

Possible values: 'auto' - The system determines whether the view is important for accessibility - default (recommended). 'yes' - The view is important for accessibility. 'no' - The view is not important for accessibility. 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views.

Optional onAccessibilityAction

onAccessibilityAction: function

When accessible is true, the system will try to invoke this function when the user performs an accessibility custom action.

Type declaration

    • (event: AccessibilityActionEvent): void
    • Parameters

      • event: AccessibilityActionEvent

      Returns void

Optional onAccessibilityEscape

onAccessibilityEscape: function

When accessibile is true, the system will invoke this function when the user performs the escape gesture (scrub with two fingers).

platform

ios

Type declaration

    • (): void
    • Returns void

Optional onAccessibilityTap

onAccessibilityTap: function

When accessible is true, the system will try to invoke this function when the user performs accessibility tap gesture.

platform

ios

Type declaration

    • (): void
    • Returns void

Optional onBlur

onBlur: function

When accessible is true (which is the default) this may be called when the OS-specific concept of "blur" occurs, meaning the element lost focus. Some platforms may not have the concept of blur.

Type declaration

    • (e: NativeSyntheticEvent<TargetedEvent>): void
    • Parameters

      • e: NativeSyntheticEvent<TargetedEvent>

      Returns void

Optional onFocus

onFocus: function

When accessible is true (which is the default) this may be called when the OS-specific concept of "focus" occurs. Some platforms may not have the concept of focus.

Type declaration

    • (e: NativeSyntheticEvent<TargetedEvent>): void
    • Parameters

      • e: NativeSyntheticEvent<TargetedEvent>

      Returns void

Optional onLayout

onLayout: function

Invoked on mount and layout changes with {nativeEvent: {layout: {x, y, width, height}}}

Type declaration

    • (event: LayoutChangeEvent): void
    • Parameters

      • event: LayoutChangeEvent

      Returns void

Optional onLongPress

onLongPress: function

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

Optional onMagicTap

onMagicTap: function

When accessible is true, the system will invoke this function when the user performs the magic tap gesture.

platform

ios

Type declaration

    • (): void
    • Returns void

Optional onPress

onPress: function

Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock).

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

Optional onPressIn

onPressIn: function

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

Optional onPressOut

onPressOut: function

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

Optional pressRetentionOffset

pressRetentionOffset: Insets

When the scroll view is disabled, this defines how far your touch may move off of the button, before deactivating the button. Once deactivated, try moving it back and you'll see that the button is once again reactivated! Move it back and forth several times while the scroll view is disabled. Ensure you pass in a constant to reduce memory allocations.

Optional style

style: object

Optional testID

testID: string

Used to locate this view in end-to-end tests.

text

text: string

Optional theme

Optional touchSoundDisabled

touchSoundDisabled: boolean | null

If true, doesn't play a system sound on touch.

platform

android

Optional tvParallaxProperties

tvParallaxProperties: TVParallaxProperties

(Apple TV only) Object with properties to control Apple TV parallax effects.

enabled: If true, parallax effects are enabled. Defaults to true. shiftDistanceX: Defaults to 2.0. shiftDistanceY: Defaults to 2.0. tiltAngle: Defaults to 0.05. magnification: Defaults to 1.0. pressMagnification: Defaults to 1.0. pressDuration: Defaults to 0.3. pressDelay: Defaults to 0.0.

platform

ios