Skip to content

Commit

Permalink
docs: add documentation for typing animation
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedKpln committed Mar 27, 2022
1 parent 862c88b commit 56e58d4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/docs/features/typing-animation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Native dependencies

You will need to install `lottie-ios` and `lottie-react-native` in order to use default animation provided, otherwise it will fallback to text based typing animation.

:::tip
Install native dependencies only if you are going to use default typing animation.
:::

renderTypingBubble={() => <Text>Custom View (Typing...)</Text>}

## Customize

Pass `renderTypingBubble` at Chatty instance.

```jsx
import React, { useState } from 'react';
import { Chatty } from 'react-native-chatty';

export default function MyReactPage() {

return (
<Chatty
{...props}

// If you want to render whole custom animation
renderTypingBubble={() => <Text>Custom View (Typing...)</Text>}

// Or if you want to use default animation but want's to change the container
// You can grab default animation from the context, and use it that way too!.
renderTypingBubble={({ typingAnimation }) => <View style={fancyStyles}>{typingAnimation}</View>}
/>
);
}
```

0 comments on commit 56e58d4

Please sign in to comment.