Added input component

This commit is contained in:
Patrick Alvin Alcala 2025-09-26 11:44:57 +08:00
parent 7b1c1082f3
commit 6a5bea364c
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,22 @@
import './Input.sass'
import { TextField } from '@kobalte/core/text-field'
import { Show, type Setter } from 'solid-js'
interface Props {
label?: string
value: string
onChange: Setter<string>
}
export default (props: Props) => {
return (
<>
<TextField class="text-field" value={props.value} onChange={props.onChange}>
<Show when={props.label}>
<TextField.Label class="text-field__label">{props.label}</TextField.Label>
</Show>
<TextField.Input class="text-field__input" />
</TextField>
</>
)
}