Skip to main content
TableCaption
@coinbase/cds-web@8.13.6
Sets an accessible title or caption for Table.
Import
import { TableCaption } from '@coinbase/cds-web/tables/TableCaption'
SourceView source codeStorybookView Storybook

Basic usage

Loading...
Live Code
<Table bordered>
  <TableCaption>Simple Table Caption</TableCaption>
  <TableHeader>
    <TableRow>
      <TableCell title="Name" />
      <TableCell title="Role" />
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell title="John Doe" />
      <TableCell title="Developer" />
    </TableRow>
  </TableBody>
</Table>

Custom Content

Loading...
Live Code
<Table bordered>
  <TableCaption>
    <VStack gap={1}>
      <TextTitle2 as="h2" color="primary">
        Project Team
      </TextTitle2>
      <Text as="p" color="foregroundMuted">
        Updated as of March 2024
      </Text>
    </VStack>
  </TableCaption>
  <TableHeader>
    <TableRow>
      <TableCell title="Name" />
      <TableCell title="Role" />
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell title="John Doe" />
      <TableCell title="Developer" />
    </TableRow>
  </TableBody>
</Table>

Styling Options

Loading...
Live Code
<Table bordered>
  <TableCaption
    align="center"
    color="fgPrimary"
    backgroundColor="bgAlternate"
    innerSpacing={{ spacingHorizontal: 2, spacingVertical: 1 }}
    outerSpacing={{ spacingHorizontal: 0, spacingVertical: 1 }}
  >
    Quarterly Revenue Report
  </TableCaption>
  <TableHeader>
    <TableRow>
      <TableCell title="Quarter" />
      <TableCell title="Revenue" />
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell title="Q1 2024" />
      <TableCell title="$1.2M" />
    </TableRow>
  </TableBody>
</Table>

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.