Compare a value against two attributes in the index

I’ve been struggling to do what appears to be a simple task, but haven’t been able to do so.
I need to build a search UI where the user can input a measurement, which I will then compare against the min/max properties of that measurement in the index.

Let’s say the measurement is width, the index contains properties for “min_width” and “max_width”, and my goal is to feed in a filter to retrieve all records for where the min and max width attributes are below and above the user input respectively.

Running a filter like this when the UI first mounts works as I was hoping, with something like:

<Configure filters={ collections:${handle} AND named_tags.min_width <= 20 AND named_tags.max_width >= 20 } hitsPerPage={8} ></Configure>

But I’m struggling to achieve the same effect programmatically and based on user input, so that 20 in the filter above would be replaced by whatever the user had put in.

The RangeInput is not an option here because I’m trying to compare against two properties of each document in the index.