Skip to content

coconut-xr/input

Repository files navigation

@coconut-xr/input

Version License Twitter

input fields for 3D UIs with @coconut-xr/koestlich

npm i @coconut-xr/input

Usage

CodeSandbox

Screenshot

const [text1, setText1] = useState("Input Field");
const [text2, setText2] = useState("Text Area\nMultiline");
return (
  <Canvas {...inputCanvasProps}>
    <OrbitControls enableRotate={false} />
    <RootContainer backgroundColor="green" loadYoga={loadYoga}>
      <Input value={text1} onChange={setText1} />
      <TextArea value={text2} onChange={setText2} />
    </RootContainer>
  </Canvas>
);

inputCanvasProps sets onPointerDown on the canvas to prevent the default behavior which is required to prevent deselecting the currently selected input field.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published