FitText

Example Usage

import { FitText } from '@alitajs/antd-plus';

Demo

SyntaxError: No-Inline evaluations must call `render`.

You can view the effect through resize browser.

expand codeexpand code
render(
  <FitText>
    <h1>Hello World!</h1>  
  </FitText>
)
SyntaxError: No-Inline evaluations must call `render`.
SyntaxError: No-Inline evaluations must call `render`.

Simplest of usage.

expand codeexpand code
render(
  <div style={{ width: 300 }}>
    <FitText>
      <h1>Hello World!</h1>  
    </FitText>
  </div>
)
SyntaxError: No-Inline evaluations must call `render`.

API#

FitText#

Property Description Type Default
compressor 按比例缩小或增加字体大小 number 1
minFontSize 最小的字体大小 number Number.NEGATIVE_INFINITY
maxFontSize 最大的字体大小 string Number.POSITIVE_INFINITY