Data table: Sticky header
Give the container a max height with containerClassName and set stickyHeader. The header stays put and gains a hairline once the rows scroll under it. Shift-drag over the checkboxes scrolls the box as you near its edge.
| Method | Country | |||||
|---|---|---|---|---|---|---|
| [email protected] | Card | United States | 2026-01-01 | $5.00 | ||
| [email protected] | PayPal | Japan | 2026-02-02 | $84.20 | ||
| [email protected] | Bank | Germany | 2026-03-03 | $163.40 | ||
| [email protected] | Apple Pay | Brazil | 2026-04-04 | $242.60 | ||
| [email protected] | Card | India | 2026-05-05 | $321.80 | ||
| [email protected] | PayPal | United States | 2026-06-06 | $401.00 | ||
| [email protected] | Bank | Japan | 2026-07-07 | $480.10 | ||
| [email protected] | Apple Pay | Germany | 2026-08-08 | $559.30 | ||
| [email protected] | Card | Brazil | 2026-09-09 | $638.50 | ||
| [email protected] | PayPal | India | 2026-01-10 | $717.70 | ||
| [email protected] | Bank | United States | 2026-02-11 | $796.90 | ||
| [email protected] | Apple Pay | Japan | 2026-03-12 | $876.10 | ||
| [email protected] | Card | Germany | 2026-04-13 | $955.30 | ||
| [email protected] | PayPal | Brazil | 2026-05-14 | $34.50 | ||
| [email protected] | Bank | India | 2026-06-15 | $113.70 | ||
| [email protected] | Apple Pay | United States | 2026-07-16 | $192.90 | ||
| [email protected] | Card | Japan | 2026-08-17 | $272.00 | ||
| [email protected] | PayPal | Germany | 2026-09-18 | $351.20 | ||
| [email protected] | Bank | Brazil | 2026-01-19 | $430.40 | ||
| [email protected] | Apple Pay | India | 2026-02-20 | $509.60 | ||
| [email protected] | Card | United States | 2026-03-21 | $588.80 | ||
| [email protected] | PayPal | Japan | 2026-04-22 | $668.00 | ||
| [email protected] | Bank | Germany | 2026-05-23 | $747.20 | ||
| [email protected] | Apple Pay | Brazil | 2026-06-24 | $826.40 | ||
| [email protected] | Card | India | 2026-07-25 | $905.60 | ||
| [email protected] | PayPal | United States | 2026-08-26 | $984.80 | ||
| [email protected] | Bank | Japan | 2026-09-27 | $63.90 | ||
| [email protected] | Apple Pay | Germany | 2026-01-01 | $143.10 | ||
| [email protected] | Card | Brazil | 2026-02-02 | $222.30 | ||
| [email protected] | PayPal | India | 2026-03-03 | $301.50 | ||
| [email protected] | Bank | United States | 2026-04-04 | $380.70 | ||
| [email protected] | Apple Pay | Japan | 2026-05-05 | $459.90 | ||
| [email protected] | Card | Germany | 2026-06-06 | $539.10 | ||
| [email protected] | PayPal | Brazil | 2026-07-07 | $618.30 | ||
| [email protected] | Bank | India | 2026-08-08 | $697.50 | ||
| [email protected] | Apple Pay | United States | 2026-09-09 | $776.70 | ||
| [email protected] | Card | Japan | 2026-01-10 | $855.80 | ||
| [email protected] | PayPal | Germany | 2026-02-11 | $935.00 | ||
| [email protected] | Bank | Brazil | 2026-03-12 | $14.20 | ||
| [email protected] | Apple Pay | India | 2026-04-13 | $93.40 | ||
| [email protected] | Card | United States | 2026-05-14 | $172.60 | ||
| [email protected] | PayPal | Japan | 2026-06-15 | $251.80 | ||
| [email protected] | Bank | Germany | 2026-07-16 | $331.00 | ||
| [email protected] | Apple Pay | Brazil | 2026-08-17 | $410.20 | ||
| [email protected] | Card | India | 2026-09-18 | $489.40 | ||
| [email protected] | PayPal | United States | 2026-01-19 | $568.60 | ||
| [email protected] | Bank | Japan | 2026-02-20 | $647.70 | ||
| [email protected] | Apple Pay | Germany | 2026-03-21 | $726.90 | ||
| [email protected] | Card | Brazil | 2026-04-22 | $806.10 | ||
| [email protected] | PayPal | India | 2026-05-23 | $885.30 | ||
| [email protected] | Bank | United States | 2026-06-24 | $964.50 | ||
| [email protected] | Apple Pay | Japan | 2026-07-25 | $43.70 | ||
| [email protected] | Card | Germany | 2026-08-26 | $122.90 | ||
| [email protected] | PayPal | Brazil | 2026-09-27 | $202.10 | ||
| [email protected] | Bank | India | 2026-01-01 | $281.30 | ||
| [email protected] | Apple Pay | United States | 2026-02-02 | $360.50 | ||
| [email protected] | Card | Japan | 2026-03-03 | $439.60 | ||
| [email protected] | PayPal | Germany | 2026-04-04 | $518.80 | ||
| [email protected] | Bank | Brazil | 2026-05-05 | $598.00 | ||
| [email protected] | Apple Pay | India | 2026-06-06 | $677.20 | ||
| [email protected] | Card | United States | 2026-07-07 | $756.40 | ||
| [email protected] | PayPal | Japan | 2026-08-08 | $835.60 | ||
| [email protected] | Bank | Germany | 2026-09-09 | $914.80 | ||
| [email protected] | Apple Pay | Brazil | 2026-01-10 | $994.00 | ||
| [email protected] | Card | India | 2026-02-11 | $73.20 | ||
| [email protected] | PayPal | United States | 2026-03-12 | $152.40 | ||
| [email protected] | Bank | Japan | 2026-04-13 | $231.50 | ||
| [email protected] | Apple Pay | Germany | 2026-05-14 | $310.70 | ||
| [email protected] | Card | Brazil | 2026-06-15 | $389.90 | ||
| [email protected] | PayPal | India | 2026-07-16 | $469.10 | ||
| [email protected] | Bank | United States | 2026-08-17 | $548.30 | ||
| [email protected] | Apple Pay | Japan | 2026-09-18 | $627.50 | ||
| [email protected] | Card | Germany | 2026-01-19 | $706.70 | ||
| [email protected] | PayPal | Brazil | 2026-02-20 | $785.90 | ||
| [email protected] | Bank | India | 2026-03-21 | $865.10 | ||
| [email protected] | Apple Pay | United States | 2026-04-22 | $944.30 | ||
| [email protected] | Card | Japan | 2026-05-23 | $23.40 | ||
| [email protected] | PayPal | Germany | 2026-06-24 | $102.60 | ||
| [email protected] | Bank | Brazil | 2026-07-25 | $181.80 | ||
| [email protected] | Apple Pay | India | 2026-08-26 | $261.00 | ||
| [email protected] | Card | United States | 2026-09-27 | $340.20 | ||
| [email protected] | PayPal | Japan | 2026-01-01 | $419.40 | ||
| [email protected] | Bank | Germany | 2026-02-02 | $498.60 | ||
| [email protected] | Apple Pay | Brazil | 2026-03-03 | $577.80 | ||
| [email protected] | Card | India | 2026-04-04 | $657.00 | ||
| [email protected] | PayPal | United States | 2026-05-05 | $736.20 | ||
| [email protected] | Bank | Japan | 2026-06-06 | $815.30 | ||
| [email protected] | Apple Pay | Germany | 2026-07-07 | $894.50 | ||
| [email protected] | Card | Brazil | 2026-08-08 | $973.70 | ||
| [email protected] | PayPal | India | 2026-09-09 | $52.90 | ||
| [email protected] | Bank | United States | 2026-01-10 | $132.10 | ||
| [email protected] | Apple Pay | Japan | 2026-02-11 | $211.30 | ||
| [email protected] | Card | Germany | 2026-03-12 | $290.50 | ||
| [email protected] | PayPal | Brazil | 2026-04-13 | $369.70 | ||
| [email protected] | Bank | India | 2026-05-14 | $448.90 | ||
| [email protected] | Apple Pay | United States | 2026-06-15 | $528.10 | ||
| [email protected] | Card | Japan | 2026-07-16 | $607.20 | ||
| [email protected] | PayPal | Germany | 2026-08-17 | $686.40 | ||
| [email protected] | Bank | Brazil | 2026-09-18 | $765.60 | ||
| [email protected] | Apple Pay | India | 2026-01-19 | $844.80 |
0 of 1,000 rows selected
Page 1 of 10
This adds the example as components/examples/data-table/sticky-header.tsx, together with the Data table component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/data-table-sticky-header.jsonTo add only the component, follow the Data table installation.
Props in this example
The Data table props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
tableThe table returned by useDataTable. | DataTableInstance<TData> | – |
| Prop | Type | Default |
|---|---|---|
stickyHeaderNeeds a max height on the container. | boolean | false |
containerClassNameApplied to the scroll container. | string | – |
| Prop | Type | Default |
|---|---|---|
placeholder | string | "Search…" |
| Prop | Type | Default |
|---|---|---|
column | Column | – |
title | string | – |
| Prop | Type | Default |
|---|---|---|
table | Table | – |
| Prop | Type | Default |
|---|---|---|
row | Row | – |
Every prop is in the Data table API reference.
See them all, with keyboard support and accessibility notes, on the Data table page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- CheckboxA checkbox whose check draws in, with indeterminate parents, groups and labels that share its hover.
- SkeletonPlaceholders that wait 150ms before showing, take the exact size of the content they wrap, and fade it in without moving anything.
- TableA responsive table with a surface style, wrapping or compact cells, sticky headers, pinned columns and scroll hints.
- AvatarUser photos with an initials fallback, status badges and stacked groups that collapse into a count.
- BadgeStatus labels with colored dots, removable tags that slide closed and counts that roll to their new value.