メインコンテンツへスキップ

Text スタイルプロパティ

使用例

リファレンス

Props

color

color

fontFamily

string

fontSize

number

fontStyle

enum('normal', 'italic')

fontWeight

フォントの太さを指定します。ほとんどのフォントで'normal''bold'の値がサポートされています。すべてのフォントが各数値値のバリアントを持っているわけではなく、その場合は最も近いものが選択されます。

デフォルト
enum('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') または number'normal'

includeFontPadding
Android

特定のアセンダ/ディセンダのためのスペースを確保するための余分なフォントパディングを削除するには、falseに設定します。一部のフォントでは、このパディングにより、垂直方向に中央揃えされたときにテキストがわずかにずれて見えることがあります。最良の結果を得るには、textAlignVerticalcenterに設定してください。

デフォルト
booltrue

fontVariant

フォントのすべてのフォントバリアントを設定できます。列挙型配列またはスペース区切りの文字列(例:'small-caps common-ligatures')を使用して設定できます。

デフォルト
enum('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') の配列、または文字列[]

letterSpacing

文字間の間隔を増減します。デフォルトでは、余分な文字間隔はありません。

number

lineHeight

テキスト要素内のテキスト行間の垂直方向の間隔を制御する数値。連続するテキスト行のベースライン間の距離を指定します。

number

textAlign

テキストの配置を指定します。Androidでは、'justify' の値はOreo (8.0) 以降 (APIレベル >= 26) でのみサポートされています。それより古いAndroidバージョンでは、値はleftにフォールバックします。

デフォルト
enum('auto', 'left', 'right', 'center', 'justify')'auto'

textAlignVertical
Android

デフォルト
enum('auto', 'top', 'bottom', 'center')'auto'

textDecorationColor
iOS

color

textDecorationLine

デフォルト
enum('none', 'underline', 'line-through', 'underline line-through')'none'

textDecorationStyle
iOS

デフォルト
enum('solid', 'double', 'dotted', 'dashed')'solid'

textShadowColor

color

textShadowOffset

オブジェクト: {width?: number, height?: number}

textShadowRadius

number

textTransform

デフォルト
enum('none', 'uppercase', 'lowercase', 'capitalize')'none'

verticalAlign
Android

デフォルト
enum('auto', 'top', 'bottom', 'middle')'auto'

writingDirection
iOS

デフォルト
enum('auto', 'ltr', 'rtl')'auto'

userSelect

ユーザーがテキストを選択し、ネイティブのコピー&ペースト機能を使用できるようにします。selectableプロパティよりも優先されます。

デフォルト
enum('auto', 'text', 'none', 'contain', 'all')none