# Table (/layout/table)





<ComponentPreview name="table-demo" description="Table with selection and sorting." />

## Sortable table [#sortable-table]

<ComponentPreview name="table-demo-sort" description="Table with sorting." />

# Resizable table [#resizable-table]

<ComponentPreview name="table-demo-resizable" description="Table with resize functionality." />

# Drag and drop table [#drag-and-drop-table]

<ComponentPreview name="table-demo-drag" description="Table with drag and drop functionality." />

## Interactive cells [#interactive-cells]

<ComponentPreview name="table-interactive-cells-preskok-demo" description="Tab between text fields inside selectable table rows." />

Set `keyboardNavigationBehavior="tab"` when cells contain interactive controls.
This keeps arrow keys and text input inside the control while

<kbd>Tab</kbd> moves through each focusable cell.

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger id="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger id="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent id="cli">
    ```bash
    npx shadcn@latest add @preskok/table
    ```
  </TabsContent>

  <TabsContent id="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.

        <ComponentSource name="table" title="registry/preskok/ui/preskok-ui/table.tsx" />
      </Step>

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Usage [#usage]

```tsx
import { Table } from "@/components/ui/preskok-ui/table"

export function TableDemo() {
  return <Table rows={[]} columns={[]} />
}
```
