Skip to content

Commit 24551fd

Browse files
authored
Merge pull request #6 from dabakovich/demo-gif
Update readme, add demo gif
2 parents 2ef3f04 + 4e493f2 commit 24551fd

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

README.md

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
React Native Controlled Mentions
1+
react-native-controlled-mentions ![](https://img.shields.io/npm/v/react-native-controlled-mentions)
22
-
3-
4-
### About
5-
63
Pretty simple and fully controlled mentions input. It can:
74

85
* Gracefully render formatted mentions directly in RN `TextInput` component
96
* Use `value`/`onChange` as in usual `TextInput` props
107
* Completely typed (written on TypeScript)
118
* No need native libraries
129

13-
### Getting started
10+
Demo
11+
-
12+
Try it on Expo Snack: https://snack.expo.io/@dabakovich/mentionsapp
13+
14+
![](demo.gif)
15+
16+
Getting started
17+
-
1418

1519
Install the library using either Yarn:
1620

@@ -20,9 +24,8 @@ or npm:
2024

2125
``npm install --save react-native-controlled-mentions``
2226

23-
### Example
24-
25-
Try it on Expo Snack: https://snack.expo.io/@dabakovich/mentionsapp
27+
Example
28+
-
2629

2730
```tsx
2831
import * as React from 'react';
@@ -94,7 +97,8 @@ const App = () => {
9497
export default App;
9598
```
9699

97-
### Configuration
100+
Configuration
101+
-
98102

99103
The `Mentions` component supports next props:
100104

@@ -109,7 +113,8 @@ The `Mentions` component supports next props:
109113
| containerStyle | StyleProp\<ViewStyle> | false | | |
110114
| ...textInputProps | TextInputProps | false | | Other text input props |
111115

112-
### Parsing `Mention`'s value
116+
Parsing `Mention`'s value
117+
-
113118

114119
You can import RegEx that is using in the component and then extract all your mentions
115120
from `Mention`'s value using your own logic.
@@ -130,12 +135,14 @@ console.log(replaceMentionValues(value, ({id}) => `@${id}`)); // Hello @5! How a
130135
console.log(replaceMentionValues(value, ({name}) => `@${name}`)); // Hello @David Tabaka! How are you?
131136
```
132137

133-
### To Do
138+
To Do
139+
-
134140

135141
* Add more customizations
136142
* Add ability to handle few mention types ("#", "@" etc)
137143

138-
### Known issues
144+
Known issues
145+
-
139146

140147
* Mention name regex accepts white spaces (eg `{name: ' ', value: 1}`)
141148
* ~~Keyboard auto-correction not working if suggested word has the same length~~ FIXED

demo.gif

439 KB
Loading

0 commit comments

Comments
 (0)