mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-29 05:02:52 +08:00
[ui][text input] add asterisk to label for required fields
This commit is contained in:
@ -30,6 +30,9 @@ export default {
|
||||
placeholder: {
|
||||
control: 'text',
|
||||
},
|
||||
required: {
|
||||
control: 'boolean',
|
||||
},
|
||||
type: {
|
||||
control: 'text',
|
||||
},
|
||||
@ -111,6 +114,17 @@ export function Disabled() {
|
||||
);
|
||||
}
|
||||
|
||||
export function Required() {
|
||||
return (
|
||||
<TextInput
|
||||
label="Required input"
|
||||
placeholder="John Doe"
|
||||
required={true}
|
||||
type="text"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function Error() {
|
||||
const [value, setValue] = useState('1234');
|
||||
|
||||
|
Reference in New Issue
Block a user