22 lines
560 B
TypeScript
22 lines
560 B
TypeScript
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>
|
|
</>
|
|
)
|
|
}
|