Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enableCellHoverReveal column option #429

Open
wants to merge 10 commits into
base: v2
Choose a base branch
from

Conversation

laratran
Copy link
Contributor

@laratran laratran commented Oct 28, 2024

Usage

const Example = () => {
  const columns = useMemo<MRT_ColumnDef<Person>[]>(
    () => [
      {
        accessorKey: 'firstName',
        header: 'First Name',
      },
      {
        accessorKey: 'lastName',
        header: 'Last Name',
      },
      {
        accessorKey: 'email',
        header: 'Email',
        enableCellHoverReveal: true,
        size: 75
      },
      {
        accessorKey: 'city',
        header: 'City',
      },
    ],
    [],
  );

  const table = useMantineReactTable({
    columns,
    data,
    layoutMode: 'grid'
  });

  return <MantineReactTable table={table} />;
};

basic table

image

highlightOnHover: false

image

striped: true

image

Limitations

passing props through mantineTableBodyCellProps

Passing some props through mantineTableBodyCellProps might not work as expected.
For example, passing align:'right' to mantineTableBodyCellProps is not applied on cells that have the hover reveal enabled
Below, all cells are right aligned except for the ones that have overflow.

image

Copy link

vercel bot commented Oct 28, 2024

@laratran is attempting to deploy a commit to the Kevin Vandy OSS Team on Vercel.

A member of the Team first needs to authorize it.

@laratran laratran changed the title Add enable cell hover reveal Add enableCellHoverReveal column option Oct 28, 2024
@laratran laratran marked this pull request as ready for review October 31, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant