# useMax

*Category:* Utilities
*Section:* Data aggregation hooks
*Source:* https://uikit.developers.rio.cloud/#/utilities/useMax
*Captured:* 2026-04-27T14:59:46.367Z

Returns the largest valid numeric value found at the specified path within a list of objects. Supports localized formats and gracefully skips unparsable values.

## useMax

### Example: Example 1

Longest duration: 1440 min

#### React (tsx)

```tsx
import useMax from '@rio-cloud/rio-uikit/useMax';

const deliveries = [
    { shipment: { duration: 90 } }, // in minutes
    { shipment: { duration: 150 } },
    { shipment: { duration: 1440 } },
    { shipment: { duration: 180 } },
];

export default () => {
    const maxDuration = useMax(deliveries, 'shipment.duration');

    return <div>Longest duration: {maxDuration} min</div>;
};
```

#### HTML (html)

```html
<div>Longest duration: 1440 min</div>
```

#### Props: Options for the `useMax` hook

### Options for the `useMax` hook

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| items | unknown[] | — | The array of objects to evaluate. |
| path | string | — | Dot-separated path to the numeric value inside each object. |
| options | object | — | Optional configuration for number parsing. |
| └locale | string | "en-GB" | Locale string used for parsing localized number formats. Affects grouping and decimal separator interpretation. |

#### Props: Return value of the `useMax` hook

### Return value of the `useMax` hook

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| value | number | — | The largest valid numeric value found at the given path, or 0 if none could be parsed. |