🔥 新プロジェクトのご紹介 t0ggles -究極のプロジェクト管理ツール! 🔥

データテーブルReactコンポーネント

データテーブルは生のデータの集合を表示します。通常、デスクトップエンタープライズ製品で使用されます。

データテーブルコンポーネント

以下のコンポーネントが含まれています。

  • テーブル
  • テーブルヘッダー
  • テーブルボディ
  • テーブル行
  • テーブルセル

TableRowプロパティ

名前デフォルト説明
colorsオブジェクト

Tailwind CSSカラークラスを含むオブジェクト

colors.bgIos文字列'hover:bg-black/5 dark:hover:bg-white/10'

テーブル行のホバー時の背景色

colors.bgMaterial文字列'hover:bg-md-light-secondary-container dark:hover:bg-md-dark-secondary-container'

テーブル行のホバー時の背景色

colors.dividerMaterial文字列'border-md-light-outline dark:border-md-dark-outline'

テーブル行の区切り線の色

headerブール値

TableHead内にある場合

TableCellプロパティ

名前デフォルト説明
colorsオブジェクト

Tailwind CSSカラークラスを含むオブジェクト

colors.textHeaderIos文字列'text-black/45 dark:text-white/55'

テーブルセルのヘッダーテキストの色

colors.textHeaderMaterial文字列'text-md-light-on-surface-variant dark:text-md-dark-on-surface-variant'

テーブルセルのヘッダーテキストの色

headerブール値

TableHead内にある場合

DataTable.jsx
import React from 'react';
import {
Page,
Navbar,
NavbarBackLink,
BlockTitle,
Card,
Table,
TableHead,
TableBody,
TableCell,
TableRow,
} from 'konsta/react';
export default function DataTablePage() {
return (
<Page>
<Navbar
title="Data Table"
/>
<BlockTitle>Plain table</BlockTitle>
<div className="block overflow-x-auto mt-8">
<Table>
<TableHead>
<TableRow header>
<TableCell header>Dessert (100g serving)</TableCell>
<TableCell header className="text-right">
Calories
</TableCell>
<TableCell header className="text-right">
Fat (g)
</TableCell>
<TableCell header className="text-right">
Carbs
</TableCell>
<TableCell header className="text-right">
Protein (g)
</TableCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableCell>Frozen yogurt</TableCell>
<TableCell className="text-right">159</TableCell>
<TableCell className="text-right">6.0</TableCell>
<TableCell className="text-right">24</TableCell>
<TableCell className="text-right">4.0</TableCell>
</TableRow>
<TableRow>
<TableCell>Ice cream sandwich</TableCell>
<TableCell className="text-right">237</TableCell>
<TableCell className="text-right">9.0</TableCell>
<TableCell className="text-right">37</TableCell>
<TableCell className="text-right">4.4</TableCell>
</TableRow>
<TableRow>
<TableCell>Eclair</TableCell>
<TableCell className="text-right">262</TableCell>
<TableCell className="text-right">16.0</TableCell>
<TableCell className="text-right">24</TableCell>
<TableCell className="text-right">6.0</TableCell>
</TableRow>
<TableRow>
<TableCell>Cupcake</TableCell>
<TableCell className="text-right">305</TableCell>
<TableCell className="text-right">3.7</TableCell>
<TableCell className="text-right">67</TableCell>
<TableCell className="text-right">4.3</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
<BlockTitle>Within card</BlockTitle>
<Card className="block overflow-x-auto mt-8" contentWrap={false}>
<Table>
<TableHead>
<TableRow header>
<TableCell header>Dessert (100g serving)</TableCell>
<TableCell header className="text-right">
Calories
</TableCell>
<TableCell header className="text-right">
Fat (g)
</TableCell>
<TableCell header className="text-right">
Carbs
</TableCell>
<TableCell header className="text-right">
Protein (g)
</TableCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableCell>Frozen yogurt</TableCell>
<TableCell className="text-right">159</TableCell>
<TableCell className="text-right">6.0</TableCell>
<TableCell className="text-right">24</TableCell>
<TableCell className="text-right">4.0</TableCell>
</TableRow>
<TableRow>
<TableCell>Ice cream sandwich</TableCell>
<TableCell className="text-right">237</TableCell>
<TableCell className="text-right">9.0</TableCell>
<TableCell className="text-right">37</TableCell>
<TableCell className="text-right">4.4</TableCell>
</TableRow>
<TableRow>
<TableCell>Eclair</TableCell>
<TableCell className="text-right">262</TableCell>
<TableCell className="text-right">16.0</TableCell>
<TableCell className="text-right">24</TableCell>
<TableCell className="text-right">6.0</TableCell>
</TableRow>
<TableRow>
<TableCell>Cupcake</TableCell>
<TableCell className="text-right">305</TableCell>
<TableCell className="text-right">3.7</TableCell>
<TableCell className="text-right">67</TableCell>
<TableCell className="text-right">4.3</TableCell>
</TableRow>
</TableBody>
</Table>
</Card>
</Page>
);
}
ライセンス MIT.
2022 © Konsta UI by nolimits4web.