Link

This component displays a hyperlink. On the web, it translates to an <a> tag. On mobile, it opens an embedded browser. On desktop it opens a tab in the default browser.

Styles

  • Text Styles

  • Flexbox Styles

  • View Styles

  • Transform Styles

Props

Name

Type

Description

accessibilityId

string

  • It is hard or impossible to tell by a reference to an instance of a component from where this component has been instantiated

  • You can assign this property and check instance.props.accessibilityId

  • For example accessibilityId is used in View's FocusArbitrator callback

allowFontScaling

boolean

  • Should fonts be scaled according to system setting?

autoFocus

boolean

  • Should be focused when the component is mounted, see also View's arbitrateFocus property

numberOfLines

number

  • For non-zero values, truncates with ellipsis if necessary

onHoverStart

(e: SyntheticEvent) => void

  • Called when the mouse cursor enters or leaves the view bounds

onHoverEnd

(e: SyntheticEvent) => void

  • Called when the mouse cursor enters or leaves the view bounds

onPress

(e: SyntheticEvent, url: string) => void

  • Event called when the touch or mouse button is released within the bounds of the view and the press has not been canceled

onLongPress

(e: SyntheticEvent, url:string) => void

  • Event called when a long touch or mouse (> 1000ms) button is released within the bounds of the view and the press has not been canceled

onContextMenu

(e: MouseEvent) => void

  • Event called when context menu is triggered, either by right mouse button click or context menu key

selectable

boolean

  • Can the link be included in a text selection?

style

LinkStyleRuleSet| LinkStyleRuleSet[]

  • See below for supported styles

testId

string

  • ID that can be used to identify the instantiated element for testing purposes

title

string

  • Text for a tooltip

url

string

  • URL to follow for hyperlink

Contents
Styles
Props