flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

Allow sizing of Pagination Buttons

Open julianYaman opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. I would like to have a Button group of small buttons in the same row as the Pagination component. But that's not really the issue. I just would like them to have the same size (small in this case).

Describe the solution you'd like Add an attribute to allow for sizing of the Pagination component buttons

Describe alternatives you've considered There aren't really any alternatives. Maybe to make the buttons larger again, which I don't really prefer.

Additional context Bildschirmfoto 2022-06-09 um 01 39 48

julianYaman avatar Jun 08 '22 23:06 julianYaman

It is already possible, if I'm not wrong. The buttons doesn't have defined sizes by default, they will fit to the parent size. It means that, if you do something like:

<Button.Group>
  <div className="w-10">
    <Button color="gray">Profile</Button>
  </div>
  <div className="w-10">
    <Button color="gray">Settings</Button>
  </div>
  <div className="w-10">
    <Button color="gray">Messages</Button>
  </div>
</Button.Group>

It should limit the size of the buttons. Could you please check if it works for you?

rluders avatar Jun 09 '22 06:06 rluders

@julianYaman does it help?

rluders avatar Jun 13 '22 13:06 rluders

Hey @rluders sorry, missed replying to you. Had my final exams recently. I'm going to try it with your solution, thanks 👍

julianYaman avatar Jul 06 '22 22:07 julianYaman

@rluders That solution doesn't work because ButtonGroup currently assumes the immediate children are Buttons. We might need to add a ButtonGroupContext and switch off of prop drilling to allow that behavior.

tulup-conner avatar Jul 31 '22 21:07 tulup-conner

See related #318

tulup-conner avatar Jul 31 '22 21:07 tulup-conner

This can be done by using the theme system.

rluders avatar Dec 05 '22 21:12 rluders