style-guide
style-guide copied to clipboard
New props suggestions "counter" and "limit" and "showRemaining" for the Textarea component
Hi
What do you think about support for 3 additional, value + event related props?
counter
prop is for adding a counter at the bottom right corner of the textarea to show, how many characters was entered.
limit
prop is for limiting option to have a character limit on the component. This is kind a useful when input needs to be limited to a pre-defined number.
showRemaining
prop, can be a side prop for limit
in order to show how many characters remain. Something like, 28/100
to show 28 characters of 100 left.
Type definition:
| {
limit?: null;
}
| {
limit: number;
showRemaining: boolean;
}
Hey @seahindeniz , let me discuss that with the team as at first glance it looks like introducing unnecessary complexity to the low level visual only component.
Regarding typing we are moving away from ambiguous union types for component props since they are not handled properly in doc generators and parsers (eg in storybook).