Skip to content

支持多种格式的 Text 组件,如解析链接、电话、邮箱等

Notifications You must be signed in to change notification settings

react-native-hero/styled-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@react-native-hero/styled-text

Getting started

Install the library using either Yarn:

yarn add @react-native-hero/styled-text

or npm:

npm install --save @react-native-hero/styled-text

Example

import {
  StyledText,
} from '@react-native-hero/styled-text'

<StyledText
  numberOfLines={2}
  style={{color: 'blue', fontSize: 14}}

  telText="电话"
  telStyle={{color: 'red'}}
  onTelPress={tel => {

  }}
  urlText="链接"
  urlStyle={{color: 'red'}}
  onUrlPress={url => {

  }}
  emailText="邮箱"
  emailStyle={{color: 'red'}}
  onEmailPress={email => {

  }}
  highlightStyle={{color: 'red'}}
>
  请点击https://www.baidu.com,请联系13512345678,请发送邮箱adsadasd@qq.com,高亮<i>关键字</i>
</StyledText>

About

支持多种格式的 Text 组件,如解析链接、电话、邮箱等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published