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 | |||||
|---|---|---|---|---|---|---|
| olivia.1@example.com | Card | United States | 2026-01-01 | $5.00 | ||
| jackson.1@example.com | PayPal | Japan | 2026-02-02 | $84.20 | ||
| isabella.1@example.com | Bank | Germany | 2026-03-03 | $163.40 | ||
| william.1@example.com | Apple Pay | Brazil | 2026-04-04 | $242.60 | ||
| sofia.1@example.com | Card | India | 2026-05-05 | $321.80 | ||
| liam.1@example.com | PayPal | United States | 2026-06-06 | $401.00 | ||
| olivia.2@example.com | Bank | Japan | 2026-07-07 | $480.10 | ||
| jackson.2@example.com | Apple Pay | Germany | 2026-08-08 | $559.30 | ||
| isabella.2@example.com | Card | Brazil | 2026-09-09 | $638.50 | ||
| william.2@example.com | PayPal | India | 2026-01-10 | $717.70 | ||
| sofia.2@example.com | Bank | United States | 2026-02-11 | $796.90 | ||
| liam.2@example.com | Apple Pay | Japan | 2026-03-12 | $876.10 | ||
| olivia.3@example.com | Card | Germany | 2026-04-13 | $955.30 | ||
| jackson.3@example.com | PayPal | Brazil | 2026-05-14 | $34.50 | ||
| isabella.3@example.com | Bank | India | 2026-06-15 | $113.70 | ||
| william.3@example.com | Apple Pay | United States | 2026-07-16 | $192.90 | ||
| sofia.3@example.com | Card | Japan | 2026-08-17 | $272.00 | ||
| liam.3@example.com | PayPal | Germany | 2026-09-18 | $351.20 | ||
| olivia.4@example.com | Bank | Brazil | 2026-01-19 | $430.40 | ||
| jackson.4@example.com | Apple Pay | India | 2026-02-20 | $509.60 | ||
| isabella.4@example.com | Card | United States | 2026-03-21 | $588.80 | ||
| william.4@example.com | PayPal | Japan | 2026-04-22 | $668.00 | ||
| sofia.4@example.com | Bank | Germany | 2026-05-23 | $747.20 | ||
| liam.4@example.com | Apple Pay | Brazil | 2026-06-24 | $826.40 | ||
| olivia.5@example.com | Card | India | 2026-07-25 | $905.60 | ||
| jackson.5@example.com | PayPal | United States | 2026-08-26 | $984.80 | ||
| isabella.5@example.com | Bank | Japan | 2026-09-27 | $63.90 | ||
| william.5@example.com | Apple Pay | Germany | 2026-01-01 | $143.10 | ||
| sofia.5@example.com | Card | Brazil | 2026-02-02 | $222.30 | ||
| liam.5@example.com | PayPal | India | 2026-03-03 | $301.50 | ||
| olivia.6@example.com | Bank | United States | 2026-04-04 | $380.70 | ||
| jackson.6@example.com | Apple Pay | Japan | 2026-05-05 | $459.90 | ||
| isabella.6@example.com | Card | Germany | 2026-06-06 | $539.10 | ||
| william.6@example.com | PayPal | Brazil | 2026-07-07 | $618.30 | ||
| sofia.6@example.com | Bank | India | 2026-08-08 | $697.50 | ||
| liam.6@example.com | Apple Pay | United States | 2026-09-09 | $776.70 | ||
| olivia.7@example.com | Card | Japan | 2026-01-10 | $855.80 | ||
| jackson.7@example.com | PayPal | Germany | 2026-02-11 | $935.00 | ||
| isabella.7@example.com | Bank | Brazil | 2026-03-12 | $14.20 | ||
| william.7@example.com | Apple Pay | India | 2026-04-13 | $93.40 | ||
| sofia.7@example.com | Card | United States | 2026-05-14 | $172.60 | ||
| liam.7@example.com | PayPal | Japan | 2026-06-15 | $251.80 | ||
| olivia.8@example.com | Bank | Germany | 2026-07-16 | $331.00 | ||
| jackson.8@example.com | Apple Pay | Brazil | 2026-08-17 | $410.20 | ||
| isabella.8@example.com | Card | India | 2026-09-18 | $489.40 | ||
| william.8@example.com | PayPal | United States | 2026-01-19 | $568.60 | ||
| sofia.8@example.com | Bank | Japan | 2026-02-20 | $647.70 | ||
| liam.8@example.com | Apple Pay | Germany | 2026-03-21 | $726.90 | ||
| olivia.9@example.com | Card | Brazil | 2026-04-22 | $806.10 | ||
| jackson.9@example.com | PayPal | India | 2026-05-23 | $885.30 | ||
| isabella.9@example.com | Bank | United States | 2026-06-24 | $964.50 | ||
| william.9@example.com | Apple Pay | Japan | 2026-07-25 | $43.70 | ||
| sofia.9@example.com | Card | Germany | 2026-08-26 | $122.90 | ||
| liam.9@example.com | PayPal | Brazil | 2026-09-27 | $202.10 | ||
| olivia.10@example.com | Bank | India | 2026-01-01 | $281.30 | ||
| jackson.10@example.com | Apple Pay | United States | 2026-02-02 | $360.50 | ||
| isabella.10@example.com | Card | Japan | 2026-03-03 | $439.60 | ||
| william.10@example.com | PayPal | Germany | 2026-04-04 | $518.80 | ||
| sofia.10@example.com | Bank | Brazil | 2026-05-05 | $598.00 | ||
| liam.10@example.com | Apple Pay | India | 2026-06-06 | $677.20 | ||
| olivia.11@example.com | Card | United States | 2026-07-07 | $756.40 | ||
| jackson.11@example.com | PayPal | Japan | 2026-08-08 | $835.60 | ||
| isabella.11@example.com | Bank | Germany | 2026-09-09 | $914.80 | ||
| william.11@example.com | Apple Pay | Brazil | 2026-01-10 | $994.00 | ||
| sofia.11@example.com | Card | India | 2026-02-11 | $73.20 | ||
| liam.11@example.com | PayPal | United States | 2026-03-12 | $152.40 | ||
| olivia.12@example.com | Bank | Japan | 2026-04-13 | $231.50 | ||
| jackson.12@example.com | Apple Pay | Germany | 2026-05-14 | $310.70 | ||
| isabella.12@example.com | Card | Brazil | 2026-06-15 | $389.90 | ||
| william.12@example.com | PayPal | India | 2026-07-16 | $469.10 | ||
| sofia.12@example.com | Bank | United States | 2026-08-17 | $548.30 | ||
| liam.12@example.com | Apple Pay | Japan | 2026-09-18 | $627.50 | ||
| olivia.13@example.com | Card | Germany | 2026-01-19 | $706.70 | ||
| jackson.13@example.com | PayPal | Brazil | 2026-02-20 | $785.90 | ||
| isabella.13@example.com | Bank | India | 2026-03-21 | $865.10 | ||
| william.13@example.com | Apple Pay | United States | 2026-04-22 | $944.30 | ||
| sofia.13@example.com | Card | Japan | 2026-05-23 | $23.40 | ||
| liam.13@example.com | PayPal | Germany | 2026-06-24 | $102.60 | ||
| olivia.14@example.com | Bank | Brazil | 2026-07-25 | $181.80 | ||
| jackson.14@example.com | Apple Pay | India | 2026-08-26 | $261.00 | ||
| isabella.14@example.com | Card | United States | 2026-09-27 | $340.20 | ||
| william.14@example.com | PayPal | Japan | 2026-01-01 | $419.40 | ||
| sofia.14@example.com | Bank | Germany | 2026-02-02 | $498.60 | ||
| liam.14@example.com | Apple Pay | Brazil | 2026-03-03 | $577.80 | ||
| olivia.15@example.com | Card | India | 2026-04-04 | $657.00 | ||
| jackson.15@example.com | PayPal | United States | 2026-05-05 | $736.20 | ||
| isabella.15@example.com | Bank | Japan | 2026-06-06 | $815.30 | ||
| william.15@example.com | Apple Pay | Germany | 2026-07-07 | $894.50 | ||
| sofia.15@example.com | Card | Brazil | 2026-08-08 | $973.70 | ||
| liam.15@example.com | PayPal | India | 2026-09-09 | $52.90 | ||
| olivia.16@example.com | Bank | United States | 2026-01-10 | $132.10 | ||
| jackson.16@example.com | Apple Pay | Japan | 2026-02-11 | $211.30 | ||
| isabella.16@example.com | Card | Germany | 2026-03-12 | $290.50 | ||
| william.16@example.com | PayPal | Brazil | 2026-04-13 | $369.70 | ||
| sofia.16@example.com | Bank | India | 2026-05-14 | $448.90 | ||
| liam.16@example.com | Apple Pay | United States | 2026-06-15 | $528.10 | ||
| olivia.17@example.com | Card | Japan | 2026-07-16 | $607.20 | ||
| jackson.17@example.com | PayPal | Germany | 2026-08-17 | $686.40 | ||
| isabella.17@example.com | Bank | Brazil | 2026-09-18 | $765.60 | ||
| william.17@example.com | 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.