mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-27 20:22:33 +08:00
[ui][textarea] add description prop
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user