Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhood Shapouran committed Jun 7, 2023
2 parents 8f99f5d + c7de4c9 commit e6b523b
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function App() {
// ...
```

## Complex Example
## Full Example

```js
import { StyleSheet, Linking } from 'react-native';
Expand Down Expand Up @@ -76,13 +76,13 @@ For more please visit https://reactnative.dev or read latest posts from @reactna
hashtagStyle={styles.hashtagStyle}
mentions={true}
mentionStyle={styles.mentionStyle}
emails={true}
emailStyle={styles.emailStyle}
links={true}
onMentionPress={(mention) =>
Linking.openURL(`https://twitter.com/${mention.replace('@', '')}`)
}
emails={true}
emailStyle={styles.emailStyle}
onEmailPress={(email) => Linking.openURL(`mailto:${email}`)}
links={true}
onLinkPress={(url) => Linking.openURL(url)}
>
{text}
Expand All @@ -98,6 +98,29 @@ const styles = StyleSheet.create({
// ...
```

## Available props


| Name | Type | Default | Description |
| ------------------------ | --------------- | ------------------- | ---------------------------------------------------------------------------|
| highlights | `Highlight[]` | `null` | Array of Highlight object |
| caseSensitive | `boolean` | `false` | Defines that uppercase and lowercase letters are treated as distinct |
| style | `TextStyle` | `null` | Defines the style of text |
| hashtags | `boolean` | `false` | Defines that all hashtags within the text are specified |
| hashtagStyle | `TextStyle` | `{ color: 'blue' }` | Defines the style of hashtags |
| onHashtagPress | `func` | `() => {}` | Defines what action to take when pressing on the hashtags |
| mentions | `boolean` | `false` | Defines that all mentions within the text are specified |
| mentionStyle | `TextStyle` | `{ color: 'blue' }` | Defines the style of mentions |
| onMentionPress | `func` | `() => {}` | Defines what action to take when pressing on the mentions |
| emails | `boolean` | `false` | Defines that all emails within the text are specified |
| emailStyle | `TextStyle` | `{ color: 'blue' }` | Defines the style of emails |
| onEmailPress | `func` | `() => {}` | Defines what action to take when pressing on the emails |
| links | `boolean` | `false` | Defines that all links within the text are specified |
| linkStyle | `TextStyle` | `{ color: 'blue' }` | Defines the style of links |
| onLinkPress | `func` | `() => {}` | Defines what action to take when pressing on the links |



## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
Expand Down

0 comments on commit e6b523b

Please sign in to comment.