leva icon indicating copy to clipboard operation
leva copied to clipboard

Suffix will get added to numerical input

Open xiduzo opened this issue 6 months ago • 0 comments

When adding a suffix to a numerical input value, the value changes to a string with the suffix attached.

I expected the suffix to be purely visual.

import { useControls } from "leva";
import "./styles.css";

export default function App() {
  const { test } = useControls({
    test: {
      value: 10,
      min: 10,
      suffix: "ms",
      onChange: (event) => console.log(event),
      transient: false,
    },
  });
  return (
    <div className="App">
      <h1>Output</h1>
      <h2>{test}</h2>
    </div>
  );
}

Will output

Image

Live example: https://codesandbox.io/p/sandbox/pedantic-almeida-g7np32

xiduzo avatar Jul 10 '25 11:07 xiduzo