agentleFS
icflorescuicflorescu/mantine-datatable/.github/copilot-instructions.md

mantine-datatable

Copilot instructions1.3k starsChanged 4 years agoMITView on GitHub

This is a dual-purpose repository containing both the Mantine DataTable component package and its documentation website. Understanding this hybrid architecture is crucial for effective development. The DataTable follows a composition-based architecture with specialized sub-components: Each sub-component has its own .tsx, .css, and sometimes .module.css files. Always maintain this parallel structure when adding features. Examples use import { DataTable } from 'PACKAGE' - this resolves to the local package during development. Never import from mantine-datatable in examples. Custom hooks follow the…

We split this copilot-instructions.md into the rules it gives an agent

15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Accessor pattern: Use idAccessor prop for custom ID fields, defaults to 'id'

    line 52
  2. Very specific:

    Use the CodeBlock component for syntax highlighting.

    line 84
  3. Very specific:

    Custom selection logic: Use isRecordSelectable for conditional selection

    line 100
  4. Very specific:

    Create component in package/ with .tsx and .css files

    line 121
  5. Very specific:

    Add to main DataTable.tsx component composition

    line 122
  6. Very specific:

    Create example in app/examples/new-feature/

    line 124
  7. Very specific:

    Update main navigation in app/config.ts

    line 125
  8. Distinctive:

    Use CSS custom properties for theming

    line 129
  9. Very specific:

    Follow existing naming: .mantine-datatable-component-name

    line 130
  10. Very specific:

    Import CSS in package/styles.css

    line 131
  11. Very specific:

    Add utility classes to utilityClasses.css if reusable

    line 132
  12. Distinctive:

    Use composition over inheritance for prop types

    line 137
  13. Distinctive:

    Virtualization: Not implemented - DataTable handles reasonable record counts (< 1000s)

    line 143
  14. Very specific:

    Memoization: Use useMemo for expensive column calculations

    line 144
  15. Distinctive:

    Bundle size: Keep dependencies minimal (only Mantine + React)

    line 146

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Mantine DataTable - Copilot Instructions

This is a dual-purpose repository containing both the Mantine DataTable component package and its documentation website. Understanding this hybrid architecture is crucial for effective development.

Project Architecture

Dual Repository Structure

  • Package code: package/ - The actual DataTable component exported to npm
  • Documentation site: app/, components/ - Next.js app with examples and docs
  • Build outputs: Package builds to dist/, docs build for GitHub Pages deployment

Package Development Flow

# Core development commands (use pnpm, not yarn despite legacy docs)
pnpm dev              # Start Next.js dev server for docs/examples
pnpm build:package    # Build package only (tsup + postcss)
pnpm build:docs       # Build documentation site
pnpm build            # Build both package and docs
pnpm lint             # ESLint + TypeScript checks

Component Architecture Pattern

The DataTable follows a composition-based architecture with specialized sub-components:

// Main component in package/DataTable.tsx
DataTable -> {
  DataTableHeader,
  DataTableRow[],
  DataTableFooter,
  DataTablePagination,
  DataTableLoader,
  DataTableEmptyState
}

Each sub-component has its own .tsx, .css, and sometimes .module.css files. Always maintain this parallel structure when adding features.

Development Conventions

Import Alias Pattern

Examples use import { DataTable } from '__PACKAGE__' - this resolves to the local package during development. Never import from mantine-datatable in examples.

TypeScript Patterns

  • Generic constraints: DataTable<T> where T extends record type
  • Prop composition: Props inherit from base Mantine components (TableProps, etc.)
  • Accessor pattern: Use idAccessor prop for custom ID fields, defaults to 'id'

CSS Architecture

  • Layered imports: styles.css imports all component styles
  • CSS layers: @layer mantine, mantine-datatable for proper specificity
  • Utility classes: Defined in utilityClasses.css for common patterns
  • CSS variables: Dynamic values injected via cssVariables.ts

Hook Patterns

Custom hooks follow the pattern useDataTable* and are located in package/hooks/:

  • useDataTableColumns - Column management and persistence
  • useRowExpansion - Row expansion state
  • useLastSelectionChangeIndex - Selection behavior

Documentation Development

Example Structure

Each example in app/examples/ follows this pattern:

feature-name/
├── page.tsx                    # Next.js page with controls
├── FeatureExample.tsx          # Actual DataTable implementation
└── FeaturePageContent.tsx      # Documentation content

Code Block Convention

Use the CodeBlock component for syntax highlighting. Example files should be minimal and focused on demonstrating a single feature clearly.

Data Patterns

Record Structure

Examples use consistent data shapes:

  • companies.json - Basic company data with id, name, address
  • employees.json - Employee data with departments/relationships
  • async.ts - Simulated API calls with delay/error simulation

Selection Patterns

  • Gmail-style additive selection: Shift+click for range selection
  • Trigger modes: 'checkbox' | 'row' | 'cell'
  • Custom selection logic: Use isRecordSelectable for conditional selection

Build System

Package Build (tsup)

  • ESM: tsup.esm.ts - Modern module format
  • CJS: tsup.cjs.ts - CommonJS compatibility
  • Types: tsup.dts.ts - TypeScript declarations
  • CSS: PostCSS processes styles to dist/

Documentation Deployment

  • GitHub Pages: output: 'export' in next.config.js
  • Base path: /mantine-datatable when GITHUB_PAGES=true
  • Environment injection: Package version, NPM downloads via build-time fetch

Common Patterns

Adding New Features

  1. Create component in package/ with .tsx and .css files
  2. Add to main DataTable.tsx component composition
  3. Export new types from package/types/index.ts
  4. Create example in app/examples/new-feature/
  5. Update main navigation in app/config.ts

Styling New Components

  • Use CSS custom properties for theming
  • Follow existing naming: .mantine-datatable-component-name
  • Import CSS in package/styles.css
  • Add utility classes to utilityClasses.css if reusable

TypeScript Integration

  • Extend base Mantine props where possible
  • Use composition over inheritance for prop types
  • Export all public types from package/types/index.ts
  • Maintain strict null checks and proper generics

Performance Considerations

  • Virtualization: Not implemented - DataTable handles reasonable record counts (< 1000s)
  • Memoization: Use useMemo for expensive column calculations
  • CSS-in-JS: Avoided in favor of CSS modules for better performance
  • Bundle size: Keep dependencies minimal (only Mantine + React)

Download now (ZIP)

Trending

Quiet since September.about the whole repository

Dec 2025: 5 mentionsJan 2026: 4 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 7 mentionsJun 2026: 7 mentionsJul 2026: 7 mentionsAug 2026: 1 mentionSep 2026: 6 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the icflorescu/mantine-datatable repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about icflorescu/mantine-datatable

The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 51

Talked about on GitHub and Hacker News (51 times).

On GitHub · 50

45 more on GitHub

On Hacker News · 1

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.