docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a React quantity selector component for an e-commerce shopping cart. The component should allow users to adjust product quantities using keyboard navigation and validation.
Create a QuantitySelector component with the following features:
The component should accept these props:
value: Current quantity (controlled component)onChange: Callback function called when quantity changesonConfirm: Callback function called when user presses Enter keyexport interface QuantitySelectorProps {
value: number;
onChange: (value: number | null) => void;
onConfirm: (value: number) => void;
}
export function QuantitySelector(props: QuantitySelectorProps): JSX.Element;Provides numeric input functionality with step controls and keyboard navigation support.
React library for building the component.