--- title: NativeTable description: "`NativeTable` is a component for efficiently organizing and displaying data." links: - style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/native-table/native-table.style.ts - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/native-table - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-nativetable--basic --- ## Usage ```tsx タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 タイトル 公開日 上映時間 ``` ### Change Variants ```tsx {(variant, index) => ( タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 )} ``` ### Change Size ```tsx {(size, index) => ( タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 )} ``` ### Change Color Scheme ```tsx {(colorScheme, index) => ( タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 )} ``` ### Add Outer Border To add an outer border, set `withBorder` to `true`. ```tsx タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 ``` ### Add Column Separators To add column separators, set `withColumnBorders` to `true`. ```tsx タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 ``` ### Highlight on Row Hover To highlight rows when hovered, set `highlightOnHover` to `true`. ```tsx タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 ``` ### Striped To enable striped rows, set `striped` to `true`. ```tsx {(variant, index) => ( タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 )} ``` ### Scroll Area To enable scroll area, set `withScrollArea` to `true`. ```tsx タイトル 公開日 オープニングテーマ エンディングテーマ 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 「オラはにんきもの」 「僕は永遠のお子様」 93分 ブリブリ王国の秘宝 1994年4月23日 「オラはにんきもの」 「約束SEE YOU!」 96分 雲黒斎の野望 1995年4月15日 「オラはにんきもの」 「たすけてケスタ」 94分 ヘンダーランドの大冒険 1996年4月13日 「パカッポでGO!」 「SIX COLORS BOY」 97分 暗黒タマタマ大追跡 1997年4月19日 「年中夢中"I WANT YOU"」 「ひまわりの家」 96分 ``` ### Sticky Header To make the header sticky, set `stickyHeader` to `true`. ```tsx タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 電撃!ブタのヒヅメ大作戦 1998年4月18日 99分 爆発!温泉わくわく大決戦 1999年4月17日 99分 嵐を呼ぶジャングル 2000年4月22日 88分 嵐を呼ぶ モーレツ!オトナ帝国の逆襲 2001年4月21日 89分 嵐を呼ぶ アッパレ!戦国大合戦 2002年4月20日 95分 ``` ### Add a Caption ```tsx ©臼井儀人/双葉社 タイトル 公開日 上映時間 アクション仮面VSハイグレ魔王 1993年7月24日 93分 ブリブリ王国の秘宝 1994年4月23日 96分 雲黒斎の野望 1995年4月15日 94分 ヘンダーランドの大冒険 1996年4月13日 97分 暗黒タマタマ大追跡 1997年4月19日 96分 ``` ## Props ### NativeTable.Root | Prop | Default | Type | Description | | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm"` | The size of the component. | | `variant` | `"line"` | `"line" \| "outline"` | The variant of the component. | | `highlightOnHover` | `false` | `boolean` | If `true`, highlight the row when the table row is hovered. | | `highlightOnSelected` | `false` | `boolean` | If `true`, highlight the row when the table row is selected. | | `layout` | - | `"-moz-initial" \| "auto" \| "fixed" \| "inherit" \| "initial" \| "revert-layer" \| "revert" \| "unset" ...` | The CSS `table-layout` property. | | `scrollAreaProps` | - | `NativeTableAreaProps` | The props for the scroll area. | | `stickyFooter` | `false` | `boolean` | If `true`, display the sticky footer. | | `stickyHeader` | `false` | `boolean` | If `true`, display the sticky header. | | `striped` | `false` | `boolean` | If `true`, display striped rows. | | `withBorder` | `false` | `boolean` | If `true`, display the outer border of the table. | | `withColumnBorders` | `false` | `boolean` | If `true`, display line on the columns of the table. | | `withScrollArea` | `false` | `boolean` | Whether to enable the scroll area. | ### NativeTable.Caption | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `placement` | `"end"` | `SimpleDirection` | The placement of the table caption. | ### NativeTable.Col | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### NativeTable.Colgroup | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### NativeTable.Tbody | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### NativeTable.Td | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `numeric` | `false` | `boolean` | Aligns the cell content to the right. | ### NativeTable.Tfoot | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### NativeTable.Th | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `numeric` | `false` | `boolean` | Aligns the cell content to the right. | ### NativeTable.Thead | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### NativeTable.Tr | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. |