1

in my app I'm working with mui-datatables. I added a custom toolbar to the table with one additional button, which is added into the row with the other buttons. But when I add a second button, it gets added below, although there is enough space. How can I display the second button in the row with the other ones?

example

  const HeaderElements = () => (
    <>
      <AddNewButton />
      <ExportJsonButton />
    </>
  );

  <MUIDataTable
    title=""
    data={rows}
    columns={columns}
    options={{
      selectableRowsHeader: false,
      selectableRowsHideCheckboxes: true,
      customToolbar: () => (<HeaderElements />),
    }}
   />
2
  • Could you please share a simple sample of your code in codesandbox? Commented Aug 24, 2021 at 6:55
  • It is interesting, in the codesandbox it's working with just normal buttons codesandbox.io/s/inspiring-haze-vvcm1?file=/src/App.js Commented Aug 24, 2021 at 7:12

1 Answer 1

1

I found the solution by myself: has to be wrapped in a Button:

<Button>
  <AddNewButton />
</Button>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.