2.0.11 • Published 4 months ago
react-use-responsive-input v2.0.11
useResponsiveInput
useResponsiveInput is a React hook that makes any input component responsive to it's text's width.
Installation
npm
npm install react-use-responsive-input
Yarn
yarn add react-use-responsive-input
Example
import useResponsiveInput from 'react-use-responsive-input'
const ResponsiveInput = ({
value,
onChange,
}: {
value: string
onChange?(value: string): void
}) => {
const responsiveInputRef = useResponsiveInput({
// options
// disabled: boolean
// extraWidth: number
// fixedValue: string
// minWidth: number
// onUpdateWidth(width: number): void
})
return (
<input
ref={responsiveInputRef}
value={value}
onChange={(e) => onChange?.(e.target.value)}
/>
)
}
2.0.11
4 months ago
2.0.3
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.9
2 years ago
2.0.10
2 years ago
2.0.8
2 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.0.4
3 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago