Table
Tables are a popular and effective way to display information in a clear and concise manner. They offer a structured way to present data, making it easy for users to scan through and locate the information they need. By using rows and columns to organize information, tables provide a systematic approach to displaying data that can help users identify patterns and insights.
Header 1 | Header 2 | Header 3 | |
|---|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 | |
Cell 1×2 | Cell 2×2 | Cell 3×2 | |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
Props
caption-side?: "top" | "bottom"
The side where the caption should be placed.
Default: bottom
fill-columns?: number
The number of columns that should be filled.
is-bordered?: boolean
If borders should be applied to all sides of the table.
Default: true
is-hoverable?: boolean
If each row should be highlighted on hover.
is-loading?: boolean
If the table is in a loading state.
is-separated?: boolean
If a border should be added between each row.
Default: true
is-striped?: boolean
If alternated colors should be added to each row.
Slots
default
The slot for the table content.
colgroups
The slot for the colgroups.
caption
The slot for the table caption.
footer
The slot for the table footer.
header
The slot for the table headers.
pagination
The slot for pagination.
Examples
Basic
A basic table.
Header 1 | Header 2 | Header 3 |
|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 |
Cell 1×2 | Cell 2×2 | Cell 3×2 |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxTable>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</template>
<script
setup
lang="ts">
import { FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Pane
A table inside a pane.
Header 1 | Header 2 | Header 3 |
|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 |
Cell 1×2 | Cell 2×2 | Cell 3×2 |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxPane>
<FluxTable>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxPane, FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Caption
A table with an caption.
Header 1 | Header 2 | Header 3 |
|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 |
Cell 1×2 | Cell 2×2 | Cell 3×2 |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxPane>
<FluxTable>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
<template #caption>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet animi asperiores, commodi cupiditate doloremque eligendi exercitationem facilis, illum ipsa ipsam modi nesciunt nobis, odit quidem sit temporibus ullam. Et, nam.
</template>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxPane, FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Sticky
A table with sticky headers.
<template>
<FluxPane>
<FluxTable style="max-height: 330px; overflow-x: hidden;">
<template #header>
<FluxTableHeader
is-sticky
is-shrinking
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 30"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxPane, FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Actions
A table with actions.
Header 1 | Header 2 | Header 3 | |
|---|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 | |
Cell 1×2 | Cell 2×2 | Cell 3×2 | |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxPane>
<FluxTable>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
<FluxTableHeader is-shrinking/>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
<FluxTableCell>
<FluxTableActions>
<FluxAction
icon="pen"/>
<FluxAction
icon="ellipsis-h"/>
</FluxTableActions>
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxAction, FluxPane, FluxTable, FluxTableActions, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Loading
A table with a loading state.
Header 1 | Header 2 | Header 3 |
|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 |
Cell 1×2 | Cell 2×2 | Cell 3×2 |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxPane>
<FluxTable
is-loading>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxPane, FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>Hoverable
A table with rows that have a hoverable state.
Header 1 | Header 2 | Header 3 |
|---|---|---|
Cell 1×1 | Cell 2×1 | Cell 3×1 |
Cell 1×2 | Cell 2×2 | Cell 3×2 |
Cell 1×3 | Cell 2×3 | Cell 3×3 |
<template>
<FluxPane>
<FluxTable
is-hoverable>
<template #header>
<FluxTableHeader
v-for="header in 3">
Header {{ header }}
</FluxTableHeader>
</template>
<FluxTableRow
v-for="row in 3"
:key="row">
<FluxTableCell
v-for="cell in 3"
:key="cell">
Cell {{ cell }}×{{ row }}
</FluxTableCell>
</FluxTableRow>
</FluxTable>
</FluxPane>
</template>
<script
setup
lang="ts">
import { FluxPane, FluxTable, FluxTableCell, FluxTableHeader, FluxTableRow } from '@flux-ui/components';
</script>