DocsGuides

Guides

Full Screen Toggle Guide

How to use, customize, or disable the full screen toggle button feature of Shadcn Table

Example

Storybook

Relevant Table Options

Prop NameTypeDescription
enableFullScreenTogglebooleanEnable or disable the full screen toggle feature. Disabling will also hide the full screen toggle button.
onIsFullScreenChangeOnChangeFn<boolean>Receives a function updater, as the TanStack Table on*Change handlers do. Resolve it with functionalUpdate, or pass a React state setter.
stTableLayoutPropsPaperProps | ({ table }} => PaperProps

Relevant State

State OptionTypeDescription
isFullScreenboolean

Disable Full Screen Toggle

The full screen toggle button is enabled by default. You can hide it by setting the enableFullScreenToggle table option to false.

const table = useShadcnTable({
  columns,
  data,
  enableFullScreenToggle: false,
});

return <ShadcnTable table={table} />;

Change Z-Index of Full Screen Table

Under the hood, when the table is full screen, these classes are applied to the root table layout element:

fixed inset-0 z-50 m-0 flex h-dvh max-h-dvh w-dvw max-w-dvw flex-col bg-background p-4

The table keeps its look in full screen: the toolbar stays above the bordered, rounded frame, and the frame grows to fill the padded window.

Full screen is a fixed overlay over the whole page, so only one table is full screen at a time. Pressing Escape inside the table leaves full screen.

If you need to change the zIndex of the full screen table, you can do so by passing in a stTableLayoutProps table option with a style object that has a zIndex property (or a z-* Tailwind class in className).

stTableLayoutProps: ({ table }) => ({
  style: {
    zIndex: table.state.isFullScreen ? 1000 : undefined,
  },
});

On this page