Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-auto-text

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-auto-text

A React component for autosizing text within a set container size

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-auto-text

npm

AutoText is a React component that allows you to have dynamic text sizing to fit inside of a component with a set height.

Install

$ npm install --save react-auto-text

Usage

import React from 'react';
import AutoText from 'react-auto-text';

function MyComponent() {
  return (
    <AutoText
      maxHeight={200}
      maxFontSize={20}
      minFontSize={10}
      onChange={fontSize => console.log(fontSize)}>
        Bacon ipsum dolor amet filet mignon salami andouille corned beef.
    </AutoText>
  );
}

export default MyComponent;

API

<AutoText>

  • maxHeight (number) Max height of the container you wish to fill. Default 100
  • maxFontSize (number) Maximum font size in pixels. Default 20
  • minFontSize (number) Minimum font size in pixels. Default 10
  • onChange (function) Optional function called when text size changes.

License

MIT

Keywords

FAQs

Package last updated on 27 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc