LyteNyte Grid Documentation

repository·main·Indexed 21 days ago

https://github.com/1771-technologies/lytenyte

A high-performance React data grid designed for speed and developer experience. LyteNyte Grid supports millions of rows, pivoting, and tree views, offering both a headless mode for custom styling and a pre-built mode for rapid development.

Tokens
298.5K
Snippets
839
Records
1.3K
Agent score
71%

What's inside LyteNyte Grid

  1. Overview of Server Data Loading in LyteNyte Grid

    main

    Server data loading allows LyteNyte Grid to handle massive datasets (millions of rows) by using partial data loading. Instead of transferring the entire dataset to the browser, the grid requests only the necessary rows from the server based on the user's current view.

    LyteNyte Grid supports three primary loading strategies:

    • Pagination: Loading data page by page.
    • Infinite scrolling: Lazily loading data as the user scrolls down.
    • Viewport-based loading: Loading only the rows currently visible in the viewport (the primary focus of the server data source).

    This approach provides direct row interaction (e.g., jumping to row 9,500) and natively supports complex operations like pivoting and grouping that are difficult to implement with standard pagination.

  2. Overview of LyteNyte Grid features

    main

    LyteNyte Grid is a high-performance React data grid designed for developer experience (DX) and performance. Key characteristics include:

    • Performance: Up to 7x faster than competing grids, handling up to 10,000 updates/sec and millions of rows at just 40 KB gzipped.
    • Feature Rich: Includes 150+ built-in features such as server-side data loading, infinite scrolling, pivoting, tree views, filtering, row grouping, and cell editing.
    • Declarative & Type-Safe API: A 100% type-safe API that allows extending column definitions and props without wrappers or extra dependencies.
    • Flexible Styling: Supports both a headless mode for ultimate customization and pre-built themes for rapid development.
    • Stateless & Prop-Driven: The grid is driven by your state (URL params, server state, etc.), ensuring zero synchronization headaches.
  3. Overview of LyteNyte Grid features

    main

    LyteNyte Grid is a high-performance grid library offering two tiers of functionality: Core and PRO.

    Core Features

    • Reactive Architecture: Declarative prop configuration, controlled/uncontrolled state, React Compiler support, and headless components.
    • Virtualization: Row and column virtualization, scroll flash suppression, and initial viewport dimension management.
    • Animations: Row and column animations with custom keyframe support.
    • Styling: Unstyled support and prebuilt themes (Tailwind, CSS Modules, CSS-in-JS).
    • Rows: Pinning, spanning, banding, variable/fixed height, and dragging (single, multi, or grid-to-grid).
    • Columns: Resizing, pinning, spanning, reordering, grouping, visibility, and autosizing.
    • Cells: Rendering, diff flashing, and tooltips/popovers.
    • Sorting: Single and multi-column sorting.
    • Selection: Row (single, multi, checkbox, isolated, linked) and Cell (single, range) selection.
    • Editing: Basic, linked, full-row, and bulk cell editing, plus validation and custom editors.
    • Filtering: Text, number, date, and quick search filters.
    • Grouping & Aggregations: Row grouping (uniform/non-uniform) and aggregations, plus Master-Detail views.
    • Data Operations: Export to Excel, CSV, Parquet, Arrow, and Clipboard operations.
    • Accessibility: Keyboard navigation, accessibility support, and RTL support.

    PRO Features

    • AI Enhanced Workflows: AI Skills.
    • API Extensions: Advanced imperative method and column extensions.
    • Annotations: Grid annotations, cell notes, and 'marching ants'.
    • Advanced Filtering: Label filters, Set filters (including Tree Set), and Having filters.
    • Expressions Engine: Filter expressions, expression editor, and plugins.
    • Advanced Grouping: Pivoting (rows, columns, measures, sorting, filtering, and grand totals).
    • Tree Data: Custom object mappings, JSON object editing, and dynamic tree creation.
    • Server Data Loading: Full server-side support for sorting, filtering, pinning, grouping, tree data, cell editing, and optimistic loading (paginated or infinite).
    • Prebuilt Components: Pill Manager, Column Manager, Tree View, Dialogs/Popovers, Menus, Smart Select, and Grid Overlays.
  4. Use the Pill Manager for grid interactions

    main

    The PillManager is a headless component used to manage data items, selection, order, and state via a list of interactive pills. It can be used for:

    • Column Visibility & Order: Toggling pills to show/hide columns or reordering them.
    • Row Grouping: Managing and reordering row groupings.
    • Label Filters: Selecting from a list of labels.
    • Column Pivoting: Creating UI for column pivot configurations by combining multiple pill rows.

    It supports two rendering modes:

    1. Default Mode: Renders using a built-in default configuration with <PillManager />.
    2. Headless Mode: Exposes component parts for full custom configuration via a render prop.
    // Default Mode
    <PillManager rows={yourRows} />
    
    // Headless Mode
    <PillManager rows={yourRows}>
      {(row) => {
        return (
          <PillManager.Row row={row}>
            <PillManager.Label row={row} />
            <PillManager.Container>
              {row.pills.map((pill) => (
                <PillManager.Pill key={pill.id} item={pill} />
              ))}
            </PillManager.Container>
            <PillManager.Expander />
          </PillManager.Row>
        );
      }}
    </PillManager>
  5. Understand the documentation project structure

    main

    The documentation is built using Next.js and Fumadocs. Key files and routes include:

    • lib/source.ts: Contains the content source adapter. The loader() function provides the interface to access your content.
    • lib/layout.shared.tsx: Contains shared layout options.
    • app/(home): Route group for the landing page and other general pages.
    • app/docs: The main documentation layout and pages.
    • app/api/search/route.ts: The Route Handler responsible for search functionality.
  6. Compare LyteNyte Grid Core vs PRO

    main

    LyteNyte Grid is available in two main editions:

    LyteNyte Grid Core (Open Source)

    • Cell Range Selection: Single and multi-range selection, controlled state, and clipboard support.
    • Basic Grid Functionality: Memory-efficient, declarative React components.

    LyteNyte Grid PRO (Enterprise)

    • AI Skills: Enhanced workflow for AI coding agents.
    • Expression Capabilities: Full expression engine, input component, advanced filtering, and plugin system.
    • Advanced Features: Includes features like Row Grouping and Row Master Detail.
  7. Features of LyteNyte Grid Core

    main

    The LyteNyte Grid Core edition is an open-source, memory-efficient version of the grid (approximately 36kb gzipped). It provides several advanced data handling features out of the box, including:

    • Row grouping: Organize data into hierarchical groups.
    • Master-detail rows: Expand rows to show detailed information.
    • Data aggregation: Perform calculations and summaries on your data sets.

    It is designed for high-performance React applications such as dashboards, admin panels, and internal tools.

  8. Accessibility Compliance in LyteNyte Grid

    main

    LyteNyte Grid is designed to meet WCAG 2.0 guidelines at levels A, AA, and AAA. Achieving Level AA compliance typically satisfies ADA standards.

    The grid achieves this by using ARIA (Accessible Rich Internet Applications) attributes on rows, cells, and headers, allowing screen readers to interpret the grid's structure and content correctly. Even when virtualization is enabled, the grid renders cells and headers in natural DOM order to ensure correct parsing by assistive technologies.

  9. What is a Row Data Source in LyteNyte Grid?

    main

    A Row Data Source is the abstraction LyteNyte Grid uses to load, manage, and render rows. It acts as the bridge between your raw data and the grid's viewport, handling the logic for how data is presented.

    Key responsibilities of a Row Data Source include:

    • Reporting total row counts (including pinned top/bottom rows).
    • Retrieving specific rows by index or ID.
    • Running data aggregations and creating dynamic pivots.
    • Updating row data in place.
    • Managing in-filter items and pagination.
  10. Overview of LyteNyte Grid Expression Capabilities (PRO)

    main

    LyteNyte Grid PRO includes an advanced expression system that allows for spreadsheet-like data manipulation. This system is composed of four main parts:

    1. Expression Engine: Parses inputs into an Abstract Syntax Tree (AST). It evaluates expressions client-side for instant feedback and allows exporting the AST for server-side processing.
    2. Expression Input Component: A built-in UI component that provides users with a familiar, spreadsheet-like typing experience for creating expressions.
    3. Advanced Expression Filter: Enables users to type complex, logic-based queries directly into the grid instead of using traditional dropdown-based filters.
    4. Expression Plugins: A plugin-based architecture that allows you to extend the engine with custom identifiers, functions, and operators (e.g., adding JavaScript-like capabilities).
  11. How the Row Sorting model works

    main

    LyteNyte Grid uses a declarative sortModel to manage sorting state. It is important to note that the grid itself does not perform the sorting logic on the data. Instead, the grid provides a sortModel (an array of sort configurations) to your row data source. Your data source is responsible for reading this model, applying the appropriate sorting logic to the data, and returning the sorted rows to the grid.

    Each item in the sortModel array conforms to the SortModelItem interface and defines which column to sort, the sort kind, and the direction.

    // Example of a single sort configuration item
    {
      columnId: "age", 
      sort: { kind: "number" }, 
      isDescending: false 
    }