[ui][textarea] add description prop

This commit is contained in:
Yangshun Tay
2022-10-29 18:21:18 +08:00
parent 9133ffc78d
commit 2e37e90cc8
2 changed files with 31 additions and 5 deletions

View File

@ -15,6 +15,9 @@ export default {
autoComplete: {
control: 'text',
},
description: {
control: 'text',
},
disabled: {
control: 'boolean',
},
@ -108,6 +111,20 @@ export function Error() {
);
}
export function Description() {
const [value, setValue] = useState('Some comment');
return (
<TextArea
description="Your message must be at least 6 characters"
errorMessage={value.length < 6 ? 'Your comment is too short' : undefined}
label="Leave a reply"
value={value}
onChange={setValue}
/>
);
}
export function ReadOnly() {
return (
<TextArea