YuktaiDocs v5.3.12

Data grid

Data grid

YuktaiGrid (React) and yuktai.renderGrid (plain HTML): search, sort, pages, selection, CSV export, five WCAG themes, Telugu UI, keyboard navigation and an optional Rust engine. Set the options for your project below; the grid and the code change together.

Playground

Set it up for your data

Features

Loading the grid…

Your code

Copy this into your project. Replace the sample rows with your own data.

app/staff/page.tsx
// generated

Control the grid from code

Everything the toolbar does is also a method. Each button runs the call shown on it against the grid above.

Grid API

app/staff/StaffGrid.tsx
"use client"
import { useGrid } from "@yuktishaalaa/yuktai"

// useGrid gives you the same search / sort / paging state to build your own table.
export function StaffTable({ rows, columns }) {
  const grid = useGrid({ data: rows, columns, engine: "auto", pagination: { pageSize: 10 } })
  return (
    <>
      <input value={grid.searchQuery} onChange={(e) => grid.setSearchQuery(e.target.value)} aria-label="Search staff" />
      <button onClick={() => grid.toggleSort("salary")}>Sort by salary</button>
      <p>{grid.filteredCount} of {grid.totalCount} rows · page {grid.page} of {grid.totalPages}</p>
      <ul>{grid.displayedData.map((r) => <li key={r.id}>{r.name}</li>)}</ul>
    </>
  )
}

Options

Grid options (React prop or renderGrid option)
OptionWhat it does
data, columns, rowKeyRows, columns and the ID field (default "id")
columns[]key, label, type ("text", "number", "date", "boolean", "badge"), align, sortable, render(value, row), hiddenOnMobile, width
engine"ts" (default), "rust" or "auto" (Rust from 10,000 rows). Same results; Rust is faster on big data
showSearchTime, onSearchTimeShows "· 0.9 ms · Rust" after each search or sort, and/or calls you with { query, ms, rows, engine }
view, mobileBreakpoint"table", "card" or "auto" (cards below 640 px)
themedefault, high-contrast, dark, color-blind, dyslexia
locale"en-IN", "en-US" or "te-IN" (Telugu labels and messages)
pagination{ pageSize, showSizeChanger, sizeOptions } or false
search, selectablefalse turns each one off
exportableVanilla only: false hides the CSV button
agenticVanilla: true or { title, examples }. React: useAgenticGrid + AgenticGridBar (see Grid agents)
ai, inputLanguage, customRulesBuilt-in assistant with voice input and your own phrases in any language
webmcp, toolName, toolDescriptionsExpose the 11 grid tools to browser AI agents
selectedKeys, highlightIds, onRowClick, onSelectionChange, onSortChangeState and events
loading, empty, label, classNameLoading state, empty message, accessible name, CSS class

Keyboard