HStack component uses flexbox to lay content out in a row.
On web only HStack is essentially the same component as Box, because Box by default has flexbox enabled (display: flex) and takes row as its initial flex-direction value.
You should use HStack when:
- you want to lay content out in columns that are sized to their content
- you want to add gaps between columns
- you want to lay content out in columns that fill the available space within the parent container
- you need columns of proportionate size to each other (also known as a ratio-based layout)
Tip
If you want to lay out children in equal width columns, or with repeated rows of columns of custom sizes, you should use Grid instead.