1.0.2 • Published 6 years ago

azir-text v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Azir Framwork : https://azir.io/docs

Text

An advance Text component for displaying text. Azir Text supports nesting, styling, and touch handling.

we have also add Pixel–perfect, native–looking Typographic styles for React Native.

Installation

to install the latest version of azir-text you only need to run:

npm install azir-text  --save

or

yarn add azir-text

We provide a series of predefined collections for you to start with that match the native design systems for iOS and Android. You can use them directly wherever you would supply a textStyle. Text Typography

Examples

Example

import Text from "azir-text";
---
<Text
    h1
    italic
    bold
    center
    color="error"
    style={ { textDecorationLine: "underline" } }
    onPress={() => {
        console.log("Text Pressed");
    }}
    >
    I am bold & <Text color="success">Green</Text>
</Text>

Props


Reference

color

Text Color

TypeRequiredDefault
azir-colorNotheme

Azir Text Sizes

you can pass any of these text sizes props., typography styles have more priority than these props.

ProptypeDefault
h1booleanSets the text's fontSize to 44px.
h2booleanSets the text's fontSize to 38px.
h3booleanSets the text's fontSize to 30px.
h4booleanSets the text's fontSize to 24px.
h5booleanSets the text's fontSize to 18px.
pbooleanSets the text's fontSize to 16px.

bold

add bold to text font style , typography styles have more priority than this prop.

TypeRequiredDefault
booleanNofalse

italic

add italic to text font style .

TypeRequiredDefault
booleanNofalse

center

align text to center .

TypeRequiredDefault
booleanNofalse

size

override text size Size, this will ovveride any premade font sizes like h1,h2 or even typography font size.

TypeRequiredDefault
numberNoAzirTheme.SIZES.FONT

style

override text style for example if you want to change fontSize,textDecorationLine,...

TypeRequired
styleNo

You Still can pass any of react native Text Props

Text Typography

Pixel–perfect, native–looking typographic styles for React Native.

This library provides a good set of defaults and helpers that cover the majority of the cases you'll need.

Installation

this library is part of azir text package

Examples

Example

import Text, {material} from "azir-text";
---
<Text style={[material.display2, { textDecorationLine: "underline" }]} italic color="error">
    Hello Material ❤️️ !
</Text>
<Text style={[material.display1, { textDecorationLine: "underline" }]} italic color="success">
    Hello Material 💚 !
</Text>
<Text style={[material.title, { textDecorationLine: "underline" }]} italic color="info">
    Hello Material 💙 !
</Text>

Typography collections

All Typography can used directly wherever you would supply a textStyle.

Tall typefaces : Language scripts that require extra line height to accommodate larger glyphs, including South and Southeast Asian and Middle-Eastern languages, like Arabic, Hindi, Telugu, Thai, and Vietnamese.

Dense typefaces : Language scripts that require extra line height to accommodate larger glyphs, including Chinese, Japanese, and Korean.

Human Interface

Dense and tall scripts are fully supported.

import Text,{ human,humanDense,humanTall } from 'azir-text'

<Text style={human.largeTitle}>Hello !</Text>
<Text style={humanDense.largeTitle}>Hello !</Text>
<Text style={humanTall.largeTitle}>Hello !</Text>
style nameSize
largeTitle34
title128
title222
title320
headlinesemi-bold, 17
body17
callout16
subhead15
footnote13
caption112
caption211

Material Design

Dense and tall scripts are fully supported.

import Text,{ material,materialDense,materialTall } from 'azir-text'

<Text style={material.display4}>Hello !</Text>
<Text style={materialDense.display4}>Hello !</Text>
<Text style={materialTall.display4}>Hello !</Text>
style nameSize
display4light,112
display356
display245
display134
headline24
titlemedium,20
subheading16
body2medium,14
body114
caption12
buttonmedium 14

iOSUIKit

Dense and tall scripts are fully supported.

import Text,{ iOSUIKit,iOSUIKitDense,iOSUIKitTall } from 'azir-text'

<Text style={iOSUIKit.largeTitle}>Hello !</Text>
<Text style={iOSUIKitDense.largeTitle}>Hello !</Text>
<Text style={iOSUIKitTall.largeTitle}>Hello !</Text>
style nameSize
largeTitleEmphasizedBold,34
title3Emphasizedsemi-bold,20
title320
bodyEmphasizedsemi-bold,17
body17
subheadEmphasizedsemi-bold,15
subhead15
subheadShortshort,15
callout16
footnoteEmphasizedsemi-bold,13
footnote13
caption2Emphasizedsemi-bold,11
caption211

Weights

A font weight in React Native is sometimes formed by a pair of a fontFamily and a fontWeight, but not always! It depends on the typeface, sometimes it's just defined by the fontFamily.With these helpers, you don't have to worry about those inconsistencies.

import Text,{ systemWeights,material } from 'azir-text'

<Text style={[material.title, systemWeights.light]}>Title</Text>
weight name
thin
light
regular
semibold
bold
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago