-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
55 lines (52 loc) · 2.25 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react';
import TextOverflow from 'react-text-overflow';
import './style.css';
const App = () => (
<main className="main-container">
<h2>Default</h2>
<section>
<p className="text-content">
<TextOverflow text="this is some text that we want to truncate." />
</p>
<p>
<TextOverflow text="this is some text that we want to truncate. Change the size of the window to check the truncation, it should truncate at the end." />
</p>
</section>
<h2>Middle truncatation</h2>
<section>
<p className="text-content">
<TextOverflow text="this is some text that we want to truncate." truncatePosition="middle" />
</p>
<p>
<TextOverflow text="this is some text that we want to truncate. Change the size of the window to check the truncation, it should truncate in the center." truncatePosition="middle" />
</p>
</section>
<h2>Start after the first character</h2>
<section>
<p className="text-content">
<TextOverflow
truncatePosition="middle"
startPos={1}
text="this is some text that we want to truncate. Change the size of the window to check the truncation, it should truncate in the center."
/>
</p>
<p>
<TextOverflow
truncatePosition="middle"
startPos={1}
text="this is some text that we want to truncate. Change the size of the window to check the truncation, it should truncate in the center."
/>
</p>
</section>
<h2>Beginning of string truncate</h2>
<section>
<p className="text-content">
<TextOverflow text="this is some text that we want to truncate." truncatePosition="start" />
</p>
<p>
<TextOverflow text="this is some text that we want to truncate. Change the size of the window to check the truncation, it should truncate at the start." truncatePosition="start" />
</p>
</section>
</main>
);
export default App;