Options
All
  • Public
  • Public/Protected
  • All
Menu

Typography컴포넌트의 props타입입니다. TextPropstype 필드가 하나 추가되었습니다.

Hierarchy

  • TextProps
    • TypographyProps

Index

Properties

Optional accessibilityActions

accessibilityActions: readonly Readonly<{ label?: string; name: AccessibilityActionName }>[]

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 adjustsFontSizeToFit

adjustsFontSizeToFit: boolean

Specifies whether font should be scaled down automatically to fit given style constraints.

Optional allowFontScaling

allowFontScaling: boolean

Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.

Optional ellipsizeMode

ellipsizeMode: "middle" | "head" | "tail" | "clip"

This can be one of the following values:

  • head - The line is displayed so that the end fits in the container and the missing text at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"
  • middle - The line is displayed so that the beginning and end fit in the container and the missing text in the middle is indicated by an ellipsis glyph. "ab...yz"
  • tail - The line is displayed so that the beginning fits in the container and the missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."
  • clip - Lines are not drawn past the edge of the text container.

The default is tail.

numberOfLines must be set in conjunction with this prop.

clip is working only for iOS

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 lineBreakMode

lineBreakMode: "middle" | "head" | "tail" | "clip"

Line Break mode. Works only with numberOfLines. clip is working only for iOS

Optional maxFontSizeMultiplier

maxFontSizeMultiplier: null | number

Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:

  • null/undefined (default): inherit from the parent node or the global default (0)
  • 0: no max, ignore parent/global default
  • = 1: sets the maxFontSizeMultiplier of this node to this value

Optional minimumFontScale

minimumFontScale: number

Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).

Optional nativeID

nativeID: string

Used to reference react managed views from native code.

Optional numberOfLines

numberOfLines: number

Used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number.

This prop is commonly used with ellipsizeMode.

Optional selectable

selectable: boolean

Lets the user select text, to use the native copy and paste functionality.

Optional selectionColor

selectionColor: string

The highlight color of the text.

Optional style

style: StyleProp<TextStyle>

Optional suppressHighlighting

suppressHighlighting: boolean

When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.

Optional testID

testID: string

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

Optional textBreakStrategy

textBreakStrategy: "simple" | "highQuality" | "balanced"

Set text break strategy on Android API Level 23+ default is highQuality.

Optional type

type: keyof TypographySheet

Typography스타일을 보관하는 일종의 Map<string, Typography>타입입니다. TypographySheet에서 어떤 스타일이 정의되어있는지 확인하세요.

Methods

Optional onAccessibilityAction

  • onAccessibilityAction(event: AccessibilityActionEvent): void
  • When accessible is true, the system will try to invoke this function when the user performs an accessibility custom action.

    Parameters

    • event: AccessibilityActionEvent

    Returns void

Optional onAccessibilityEscape

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

    platform

    ios

    Returns void

Optional onAccessibilityTap

  • onAccessibilityTap(): void
  • When accessible is true, the system will try to invoke this function when the user performs accessibility tap gesture.

    platform

    ios

    Returns void

Optional onLayout

  • onLayout(event: LayoutChangeEvent): void
  • Invoked on mount and layout changes with

    {nativeEvent: { layout: {x, y, width, height}}}.

    Parameters

    • event: LayoutChangeEvent

    Returns void

Optional onLongPress

  • onLongPress(event: GestureResponderEvent): void
  • This function is called on long press. e.g., `onLongPress={this.increaseSize}>``

    Parameters

    • event: GestureResponderEvent

    Returns void

Optional onMagicTap

  • onMagicTap(): void
  • When accessible is true, the system will invoke this function when the user performs the magic tap gesture.

    platform

    ios

    Returns void

Optional onPress

  • onPress(event: GestureResponderEvent): void
  • This function is called on press. Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).

    Parameters

    • event: GestureResponderEvent

    Returns void

Generated using TypeDoc