0.1.3 • Published 3 years ago

react-contain-textbox v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

React Contain Textbox

Resize your text and other stuff to fit a box. Anything can be contained so long as em is used in it's sizing!

Installation

npm i react-contain-textbox

Examples

Full App Example Here

ES6

import React, { useRef } from 'react';
import useContain from 'react-contain-textbox';

const App = (props) => {
	const boxRef = useRef();
	useContain(boxRef);

	return (
		<div
			ref={boxRef}
			style={{
				height: 100,
				width: 100,
			}}
		>
			<p>Buncha stuff to resize!</p>
			<img
				src="image.png"
				style={{ height: '5em', width: '5em' }}
				alt="This will too if you use em"
			/>
		</div>
	);
};

License

Copyright (c) 2020, Michael Szmadzinski. (MIT License)

0.1.3

3 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago