diff --git a/fwt/components/Input/Input.sass b/fwt/components/Input/Input.sass new file mode 100644 index 0000000..fc8e6cf --- /dev/null +++ b/fwt/components/Input/Input.sass @@ -0,0 +1,3 @@ +.input + font-size: 1rem + padding: 0.5rem 1rem diff --git a/fwt/components/Input/Input.tsx b/fwt/components/Input/Input.tsx new file mode 100644 index 0000000..c0f7c97 --- /dev/null +++ b/fwt/components/Input/Input.tsx @@ -0,0 +1,27 @@ +import './Input.sass' +import { createSignal } from 'solid-js' + +interface Props { + placeholder?: string + value?: string + onChange?: (value: string) => void +} + +export default (props: Props) => { + const [inputValue, setInputValue] = createSignal(props.value || '') + + const handleChange = (event: Event) => { + const target = event.target as HTMLInputElement + const newValue = target.value + setInputValue(newValue) + if (props.onChange) { + props.onChange(newValue) + } + } + + return ( + <> + + + ) +}