Propiedades de Estilo de Texto
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Ejemplo
- TypeScript
- JavaScript
Referencia
Props
color
| Type |
|---|
| color |
fontFamily
| Type |
|---|
| string |
fontSize
| Type |
|---|
| number |
fontStyle
| Type |
|---|
enum('normal', 'italic') |
fontWeight
Especifica el peso de la fuente. Los valores 'normal' y 'bold' son compatibles con la mayoría de fuentes. No todas las fuentes tienen una variante para cada valor numérico; en ese caso se elige el más cercano.
| Type | Default |
|---|---|
enum('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') or number | 'normal' |
includeFontPadding Android
Establece en false para eliminar el relleno adicional de fuente que reserva espacio para ascendentes/descendentes. Con algunas fuentes, este relleno puede desalinear visualmente el texto al centrarlo verticalmente. Para mejores resultados, configura también textAlignVertical como center.
| Type | Default |
|---|---|
| bool | true |
fontVariant
Permite configurar todas las variantes tipográficas mediante un array de enumeraciones o cadena separada por espacios, ej. 'small-caps common-ligatures'.
| Type | Default | ||||
|---|---|---|---|---|---|
array of enum( | [] | ||||
letterSpacing
Incrementa o reduce el espacio entre caracteres. Por defecto no hay espaciado adicional entre letras.
| Type |
|---|
| number |
lineHeight
Valor numérico que controla el espacio vertical entre líneas de texto. Especifica la distancia entre líneas base consecutivas.
| Type |
|---|
| number |
textAlign
Especifica la alineación del texto. En Android, 'justify' solo es compatible desde Oreo (8.0) o superior (API nivel >= 26). En versiones anteriores, el valor revertirá a left.
| Type | Default |
|---|---|
enum('auto', 'left', 'right', 'center', 'justify') | 'auto' |
textAlignVertical Android
| Type | Default |
|---|---|
enum('auto', 'top', 'bottom', 'center') | 'auto' |
textDecorationColor iOS
| Type |
|---|
| color |
textDecorationLine
| Type | Default |
|---|---|
enum('none', 'underline', 'line-through', 'underline line-through') | 'none' |
textDecorationStyle iOS
| Type | Default |
|---|---|
enum('solid', 'double', 'dotted', 'dashed') | 'solid' |
textShadowColor
| Type |
|---|
| color |
textShadowOffset
| Type |
|---|
object: {width?: number, height?: number} |
textShadowRadius
| Type |
|---|
| number |
textTransform
| Type | Default |
|---|---|
enum('none', 'uppercase', 'lowercase', 'capitalize') | 'none' |
verticalAlign Android
| Type | Default |
|---|---|
enum('auto', 'top', 'bottom', 'middle') | 'auto' |
writingDirection iOS
| Type | Default |
|---|---|
enum('auto', 'ltr', 'rtl') | 'auto' |
userSelect
Permite al usuario seleccionar texto y usar las funciones nativas de copiar/pegar. Tiene prioridad sobre la propiedad selectable.
| Type | Default |
|---|---|
enum('auto', 'text', 'none', 'contain', 'all') | none |