Added placeholder on input component

This commit is contained in:
Patrick Alvin Alcala 2025-10-30 16:28:23 +08:00
parent 015984c4cf
commit 596c11cd23

View file

@ -8,6 +8,7 @@ interface Props {
onChange: Setter<string> onChange: Setter<string>
onKeyDown?: (event: KeyboardEvent) => void onKeyDown?: (event: KeyboardEvent) => void
isPassword?: boolean isPassword?: boolean
placeholder?: string
} }
export default (props: Props) => { export default (props: Props) => {
@ -17,7 +18,7 @@ export default (props: Props) => {
<Show when={props.label}> <Show when={props.label}>
<TextField.Label class="text-field__label">{props.label}</TextField.Label> <TextField.Label class="text-field__label">{props.label}</TextField.Label>
</Show> </Show>
<TextField.Input class="text-field__input" type={props.isPassword ? 'password' : 'text'} /> <TextField.Input class="text-field__input" type={props.isPassword ? 'password' : 'text'} placeholder={props.placeholder || ''}/>
</TextField> </TextField>
</> </>
) )