summaryrefslogtreecommitdiffstats
path: root/examples/examples.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples.js')
-rw-r--r--examples/examples.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/examples.js b/examples/examples.js
index 622268d..c79bf11 100644
--- a/examples/examples.js
+++ b/examples/examples.js
@@ -5,6 +5,7 @@ import TextareaAutosize from '../src/TextareaAutosize';
class Example extends React.Component {
textareaStyle = {
+ width: 300,
padding: '10px 8px',
border: '1px solid rgba(39, 41, 43, .15)',
borderRadius: 4,
@@ -27,11 +28,19 @@ class Example extends React.Component {
<h2>Minimum height is 3 "rows"</h2>
<TextareaAutosize
- rows='3'
+ rows={3}
style={this.textareaStyle}
placeholder='minimun height is 3 rows'
/>
+ <h2>Maximum height is 3 "rows"</h2>
+ <TextareaAutosize
+ maxRows={3}
+ style={this.textareaStyle}
+ placeholder='maximum height is 5 rows'
+ defaultValue={'this\nis\na\nlong\ninitial\ntext'}
+ />
+
<h2>Prefilled with initial value</h2>
<TextareaAutosize
style={this.textareaStyle}