Install
npm install text-resize-and-word-wrap-provider
See DEMO
https://mrcheater.github.io/text-resize-and-word-wrap-provider/
See DEMO SOURCES
https://github.com/MrCheater/text-resize-and-word-wrap-provider/tree/master/examples
Usage
;
Browser support
- Chrome
- Safari 5.1.7+
- Edge
- IE 9
- IE 10
- IE 11
- Firefox 3.5+
- Opera 12+
- Midori (font-size < 3px - no support)
Compiler targets
- React
- Preact
- React-lite
Text (Standalone)
Simple Text
<Text x = 20 y = 30 width = 100 height = 50> Hello world</Text>
Rich Text
<Text x = 50 y = 0 width = 150 height = 70 scale = 09> <div weight = 2 color = 'red'> Title </div> <div weight = 1 italic bold> <span overline> Hello </span> <span underline> world </span> </div></Text>
PropTypes
type CSSUnitString =
Text + Context Provider
<TextResizeAndWordWrapProvider> <Text x = 20 y = 30 width = 100 height = 50 > Hello world </Text></TextResizeAndWordWrapProvider>
or
@textResizeAndWordWrapComponent { return <Text x = 20 y = 30 width = 100 height = 50 > Hello world </Text> ; }
or
Component { return <Text x = 20 y = 30 width = 100 height = 50 > Hello world </Text> ; }const Demo = ;
Build and Start Demo-Server
First Console:
npm install -g webpack@1.14.0npm install -g babel-clinpm install npm run build
Second Console:
npm run start#Open http://localhost:3000/