Skip to content

Commit bbe2aba

Browse files
committed
feat: add example of delay, backspace and paste
1 parent 015e0ef commit bbe2aba

1 file changed

Lines changed: 12 additions & 27 deletions

File tree

dev/App.tsx

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import React, { useState } from 'react';
2-
import './App.css';
1+
import React from 'react';
32
import Typist from '../src';
43
import Header from './components/Header';
54
import Section from './components/Section';
65
import PauseExample from './components/PauseExample';
76

87
function App() {
9-
const [count, setCount] = useState(0);
10-
const [key, setKey] = useState(1);
11-
128
return (
139
<div className='min-h-screen bg-slate-600 px-12 py-10 text-white'>
1410
<Header />
@@ -18,28 +14,17 @@ function App() {
1814
</Typist>
1915
</Section>
2016
<PauseExample />
21-
<button onClick={() => setKey(key + 1)}>key</button>
22-
<button onClick={() => setCount(count + 1)}>{count}</button>
23-
<br />
24-
<Typist
25-
typingDelay={100}
26-
disabled={count % 2 === 0}
27-
cursor={<span className='cursor'>|</span>}
28-
restartKey={key}
29-
>
30-
This is a typo
31-
<br />
32-
<Typist.Backspace count={5} />
33-
<Typist.Delay ms={1500} />
34-
react component
35-
<Typist.Paste>
36-
<div>
37-
use
38-
<div>deeper div</div>
39-
</div>
40-
</Typist.Paste>
41-
<Typist.Delay ms={1500} />
42-
</Typist>
17+
<Section title='Support Delay, Backspacing and Pasting'>
18+
<Typist>
19+
The typing animation can be delayed adn bac
20+
<Typist.Delay ms={1000} />
21+
<Typist.Backspace count={6} />
22+
nd backspaced
23+
<br />
24+
Furthermore,
25+
<Typist.Paste> the text can be pasted directly!</Typist.Paste>
26+
</Typist>
27+
</Section>
4328
</div>
4429
);
4530
}

0 commit comments

Comments
 (0)