File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33Create typewriter effect by setting up a component's children directly.
44
5- ## Caveat ⚠
6-
7- This package is not production-ready, Use it with caution.
8-
95## Install
106
117``` bash
@@ -43,16 +39,18 @@ const MyComponent = () => {
4339### ` Typist `
4440
4541``` ts
46- type TypistProps = {
42+ export type Delay = number | (() => number );
43+ export type Splitter = (str : string ) => string [];
44+ export type TypistProps = {
4745 children: React .ReactNode ;
48- typingDelay? : number | (() => number ) ;
49- backspaceDelay? : number | (() => number ) ;
46+ typingDelay? : Delay ;
47+ backspaceDelay? : Delay ;
5048 loop? : boolean ;
5149 pause? : boolean ;
5250 startDelay? : number ;
5351 finishDelay? : number ;
5452 onTypingDone? : () => void ;
55- splitter? : ( s : string ) => string [] ;
53+ splitter? : Splitter ;
5654 cursor? : string | React .ReactElement ;
5755 disabled? : boolean ;
5856 restartKey? : any ;
@@ -119,9 +117,7 @@ Set to `true` if you want to pause the typing animation.
119117
120118#### ` onTypingDone `
121119
122- ** Default** : ` () => {return} `
123-
124- This function will be called when the typing animation finishes. It will be called before ` finishDelay ` .
120+ This function will be called when the typing animation finishes. It will be called before waiting for the timeout with ` finishDelay ` .
125121
126122#### ` splitter `
127123
You can’t perform that action at this time.
0 commit comments