Skip to content

Commit

Permalink
docs: this commit adds new
Browse files Browse the repository at this point in the history
TypeAnimation component's props for improved
readability and consistency.
  • Loading branch information
Benjamin committed Nov 24, 2023
1 parent 8feaa81 commit 7dd259e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ The following props allows you to configure the properties for the type animatio
| `cursorStyle` | no | TextStyle | | Additional styles for the cursor. |
| `delayBetweenSequence` | no | Number | 100 | Delay between animation sequences (in milliseconds). |
| `direction` | no | String | front | Specifies the direction in which to perform the typing/deleting animation. It accepts two possible values: 'front' and 'back'. |
| `initialDelay` | no | Number | 0 | The delay before the animation begins (in milliseconds). |
| `loop` | no | Boolean | false | Whether to loop the typing animation indefinitely. |
| `preRenderText` | no | String | None | Specifies the initial text to display. |
| `repeat` | no | Number | 1 | The number of times to repeat the sequence. |
| `sequence` | yes | Array | | An array of objects defining the text to be typed and animation options. |
| `splitter` | no | Function | | A function to split text into individual characters or chunks for typing. |
Expand Down
10 changes: 5 additions & 5 deletions src/TypeAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ type TypeAnimationProps = {
/**
* Specifies the initial text to display.
*/
preRender?: string;
preRenderText?: string;
/**
* The delay before the animation begin (in milliseconds). Default: 0
* The delay before the animation begins (in milliseconds). Default: 0
*/
initialDelay?: number;
};
Expand All @@ -163,11 +163,11 @@ const TypeAnimation: React.FC<TypeAnimationProps> = ({
cursorStyle,
cursor = true,
direction = 'front',
preRender = '',
preRenderText = '',
initialDelay = 0,
}) => {
const [text, setText] = useState<string>(preRender);
let currentText = preRender;
const [text, setText] = useState<string>(preRenderText);
let currentText = preRenderText;

/**
* Type a sequence of letters with a specified speed.
Expand Down

0 comments on commit 7dd259e

Please sign in to comment.