<!---
THIS IS AN AUTOGENERATED FILE. EDIT PACKAGES/BOUNDLESS-FITTED-TEXT/INDEX.JS INSTEAD.
-->
# FittedText

This component can be useful in situations where an internationalized string is being placed into the UI and it's unclear if all variations of it will fit without excessive amounts of edge-case CSS. Ultimately, it's good at making sure what you put in doesn't overflow.

## Installation

```bash
npm i boundless-fitted-text --save
```

Then use it like:


```jsx
/** @jsx createElement */

import { createElement } from 'react';
import Button from 'boundless-button';
import FittedText from 'boundless-fitted-text';

export default () => (
    <div className='spread'>
        <Button className='tall-button'>
            <FittedText>Welcome</FittedText>
        </Button>
        <Button className='tall-button'>
            <FittedText>Добро пожаловать</FittedText>
        </Button>
        <Button className='tall-button'>
            <FittedText>Benvenuto</FittedText>
        </Button>
        <Button className='tall-button'>
            <FittedText>환영합니다</FittedText>
        </Button>
        <Button className='tall-button'>
            <FittedText>സ്വാഗതം</FittedText>
        </Button>
    </div>
);
```



FittedText can also just be directly used from the main [Boundless library](https://www.npmjs.com/package/boundless). This is recommended when you're getting started to avoid maintaining the package versions of several components:

```bash
npm i boundless --save
```

the ES6 `import` statement then becomes like:

```js
import { FittedText } from 'boundless';
```



## Props

> Note: only top-level props are in the README, for the full list check out the [website](https://boundless.js.org/FittedText).

### Required Props

There are no required props.


### Optional Props

- __`*`__ &middot; any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes)

  Expects | Default Value
  ---     | ---
  `any` | `n/a`

- __`component`__ &middot; any valid HTML tag name

  Expects | Default Value
  ---     | ---
  `string` | `'span'`

- __`upscale`__ &middot; controls if FittedText will automatically scale up the content to fit the available space; normally the component
  only scales text down as needed to fit

  Expects | Default Value
  ---     | ---
  `bool` | `false`


## Reference Styles
### Stylus
You can see what variables are available to override in [variables.styl](https://github.com/enigma-io/boundless/blob/master/variables.styl).

```stylus
// Redefine any variables as desired, e.g:
color-accent = royalblue

// Bring in the component styles; they will be autoconfigured based on the above
@require "node_modules/boundless-fitted-text/style"
```

### CSS
If desired, a precompiled plain CSS stylesheet is available for customization at `/build/style.css`, based on Boundless's [default variables](https://github.com/enigma-io/boundless/blob/master/variables.styl).

