KQ-567 · SUMMARY/HEM
Summary Hem
A sticky summary that pays for its own space. At rest it is a card of lines, total and action; scrolling the container down condenses it to a slim bar on glide, keeping the total and the button as the same travelling elements while only the itemised lines cross-fade. Scrolling back up reopens it, and the heading holds a disclosure button so Enter or Space does the same from the keyboard.
KQ-567 · SUMMARY/HEM
Coldbrook cart
- 24.00
House blend, whole bean
2 × 340g
- 13.50
Kettle point single origin
1 × 250g
- 27.00
Cold brew concentrate
3 × 1L
- 6.00
Paper filters, size 02
1 × 100
- 12.00
Decaf, water process
1 × 340g
- 9.00
Travel tin
1
- -2.50
Bag credit returned
5 bags
- Items (14)
- 89.00
- Delivery, north basin
- 4.00
- Bag credit
- -2.50
Total90.50
Hem expanded
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/summary-hem
Props
- container
- React.RefObject<HTMLElement | null>
- default —
- The scrolling element the hem listens to. The hem sits over it, not inside it.
- lines
- { label: string; value: string }[]
- default —
- Itemised lines. They are what the condensed bar gives up.
- total
- string
- default —
- Formatted total. Kept in both states, as one element that travels.
- cta
- { label: string; onPress: () => void }
- default —
- The action. Kept in both states; full width expanded, beside the total when condensed.
- heading
- string
- default "Order summary"
- Names the region and the disclosure button.
- onCondensedChange
- (condensed: boolean) => void
- default —
- Fires when the hem condenses or expands, whatever caused it.
| Prop | Type | Default | Description |
|---|---|---|---|
| container | React.RefObject<HTMLElement | null> | — | The scrolling element the hem listens to. The hem sits over it, not inside it. |
| lines | { label: string; value: string }[] | — | Itemised lines. They are what the condensed bar gives up. |
| total | string | — | Formatted total. Kept in both states, as one element that travels. |
| cta | { label: string; onPress: () => void } | — | The action. Kept in both states; full width expanded, beside the total when condensed. |
| heading | string | "Order summary" | Names the region and the disclosure button. |
| onCondensedChange | (condensed: boolean) => void | — | Fires when the hem condenses or expands, whatever caused it. |