How to check input between min & max number in react?

I have 2 costs min & max. I want when user type number in input manually then the user can only type number between min & max number. i want to do it in React/Next js.

<Input
    value={tripCoverage}
    onChange={(e) => {
        const value = e.target.value;
        const { minCost, maxCost } =
            studentPrice()?.tripCost || {};
        const result = Math.max(
            minCost,
            Math.min(maxCost, Number(value))
        );
        setTripCoverage(result);
    }}
    type="number"
/>