Skip to content

@sqlrooms/data-table / DataTableModalProps

Type Alias: DataTableModalProps ​

DataTableModalProps = object & { query: string | undefined; arrowTable?: never; } | { arrowTable: arrow.Table | undefined; query?: never; }

A modal component for displaying a table with data from a SQL query.

Type Declaration ​

NameTypeDescription
className?string-
titlestring | undefined-
tableModalPick<UseDisclosureReturnValue, "isOpen" | "onClose">-
formatValue?ArrowDataTableValueFormatterOptional custom value formatter for binary/geometry data

Component ​

Param ​

Component props

Param ​

The title of the table

Param ​

The SQL query to execute and display in the table

Param ​

An object containing the modal's open state and close function

Example ​

tsx
import { useState } from 'react';
import { DataTableModal } from '@sqlrooms/data-table';

const MyComponent = () => {
  const tableModal = useDisclosure();
  return (
    <DataTableModal
      title="Users"
      query="SELECT * FROM users LIMIT 10"
      tableModal={tableModal}
    />
  );
};