Text スタイルプロパティ
例
- TypeScript
- JavaScript
リファレンス
Props
color
fontFamily
| 型 |
|---|
| string |
汎用フォントファミリー system-ui、ui-sans-serif、ui-serif、ui-monospace、ui-rounded は iOS でサポートされています。
fontSize
| 型 |
|---|
| number |
fontStyle
| 型 |
|---|
enum('normal', 'italic') |
fontWeight
フォントの太さを指定します。ほとんどのフォントで 'normal' と 'bold' の値がサポートされています。すべてのフォントがそれぞれの数値の値に対応するバリアントを持っているわけではなく、その場合は最も近いものが選択されます。
| 型 | デフォルト |
|---|---|
enum('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') または 数値 | 'normal' |
includeFontPadding Android
特定のアセンダ/ディセンダのための余分なフォントパディングを削除するには false に設定します。一部のフォントでは、このパディングにより、垂直方向の中央揃えにしたときにテキストがわずかにずれて見えることがあります。最適な結果を得るには、textAlignVertical も center に設定してください。
| 型 | デフォルト |
|---|---|
| bool | true |
fontVariant
フォントのすべてのフォントバリアントを設定できます。enumの配列またはスペース区切りの文字列(例:'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
textDecorationLine
| 型 | デフォルト |
|---|---|
enum('none', 'underline', 'line-through', 'underline line-through') | 'none' |
textDecorationStyle iOS
| 型 | デフォルト |
|---|---|
enum('solid', 'double', 'dotted', 'dashed') | 'solid' |
textShadowColor
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 |