mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-27 20:22:33 +08:00
[ui][text input] add description prop
This commit is contained in:
@ -12,6 +12,9 @@ export default {
|
||||
autoComplete: {
|
||||
control: 'text',
|
||||
},
|
||||
description: {
|
||||
control: 'text',
|
||||
},
|
||||
disabled: {
|
||||
control: 'boolean',
|
||||
},
|
||||
@ -183,6 +186,25 @@ export function Error() {
|
||||
);
|
||||
}
|
||||
|
||||
export function Description() {
|
||||
const [value, setValue] = useState('1234567');
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
description="Select a password that is at least 6 characters"
|
||||
errorMessage={
|
||||
value.length < 6 ? 'Password must be at least 6 characters' : undefined
|
||||
}
|
||||
label="Password"
|
||||
startAddOn={KeyIcon}
|
||||
startAddOnType="icon"
|
||||
type="password"
|
||||
value={value}
|
||||
onChange={setValue}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function AddOns() {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
Reference in New Issue
Block a user