0.0.10 • Published 2 years ago

@moeui/react-auto-size-input v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

release

react-auto-size-input

Adjust the width according to the text, and can reach a certain length to reduce the font size.

Install

yarn add @moeui/react-auto-size-input // or npm i @moeui/react-auto-size-input -S

Use

import Input from '@moeui/react-auto-size-input'

 <Input value={value} onChange={val => setValue(val)} />

Props

NameDescriptionTypeDefault
valueinput valuestring'0'
onChangeTriggered when the input content is changed(value: string) => void-
onKeyDownTriggered when the input content is onKeyDowned(e: KeyboardEvent) => void-
classNameInput class namestring-
prefixThe prefix icon for the Input() => React.ReactElement \| string-
suffixThe suffix dom for the Input() => React.ReactElement \| string-
maxLengthThe maximum number of characters the user can enternumber20
shrinkText shrinks the length limitnumber12
shrinkFontSizeText shrinks font sizenumber26
fontSizeText font sizenumber36
defaultValueinput value is empty displayed valuestring'0'

Ref

NameDescriptionType
blurLet the input box lose focus() => void
clearClear the input content() => void
focusLet the input box get focus() => void

CSS Variables

NameDescriptionDefault
--colorText color.#000
--backgroundThe input background#fff
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.1

2 years ago