diff options
author | Francesco <firefelix@gmail.com> | 2015-06-29 21:59:19 +0200 |
---|---|---|
committer | Francesco <firefelix@gmail.com> | 2015-06-29 21:59:19 +0200 |
commit | 38bcbea671ac414323d3197df28d58be33217447 (patch) | |
tree | 511ff20593f1c2dafa00a17c4751e3550aac3923 /examples/examples.js | |
parent | 8addadfbb3f29eeb709149fa7465ff4c9412bdb6 (diff) | |
download | react-autosize-textarea-38bcbea671ac414323d3197df28d58be33217447.zip react-autosize-textarea-38bcbea671ac414323d3197df28d58be33217447.tar.gz react-autosize-textarea-38bcbea671ac414323d3197df28d58be33217447.tar.bz2 |
added examples and bundle for live demo
Diffstat (limited to 'examples/examples.js')
-rw-r--r-- | examples/examples.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/examples.js b/examples/examples.js new file mode 100644 index 0000000..6695316 --- /dev/null +++ b/examples/examples.js @@ -0,0 +1,42 @@ +import React from 'react'; +import TextareaAutosize from '../src/TextareaAutosize'; + +const Example = React.createClass({ + + propTypes: {}, + + getInitialState() { + return { + value: 'replace me with your component' + }; + }, + + render() { + + const textareaStyle = { + padding: '10px 8px', + border: '1px solid rgba(39,41,43,.15)', + borderRadius: 4, + fontSize: 15 + }; + + return ( + <div style={{fontFamily: 'sans-serif', margin: 15}}> + <h2>Empty</h2> + <TextareaAutosize style={textareaStyle} placeholder='try writing some lines'/> + + <h2>Minimum Height</h2> + <TextareaAutosize rows='3' style={textareaStyle} placeholder='minimun height is 3 rows'/> + + <h2>Prefilled</h2> + <TextareaAutosize style={textareaStyle} defaultValue={'this\nis\na\nlong\ninitial\ntext'}/> + + <h2>{'You can compare with this normal react <textarea>'}</h2> + <textarea style={textareaStyle} defaultValue={'this\nis\na\nlong\ninitial\ntext'}/> + </div> + ); + } + +}); + +React.render(<Example />, document.getElementById('container'));
\ No newline at end of file |