Natural numeric sorting handles labels such as item 2 and item 10 in a familiar order. Use a collator with an explicit locale where order matters.
Worked example
// components/NaturalNumericOrder.tsx
export default function NaturalNumericOrder({
entries = ["Beta", "Alpha", "Gamma"],
}: { entries?: string[] } = {}) {
const collator = new Intl.Collator("en", { numeric: true });
return (
<ol>
{[...entries].sort(collator.compare).map((v, i) => (
<li key={i}>{v}</li>
))}
</ol>
);
}Implementation notes
Numeric comparison still needs a locale and tie policy. Two visually similar labels with different padding can compare as equivalent.
Try it yourself
Include padded numbers and mixed case among the labels.
Open the React example →Editorial date October 24, 2025 · Published December 6, 2026