Show the label (children) of a Button responsively #8721
jalik
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There seems to have no way of hiding the label of a
<Button>on small screens using a prop.This is how I would achieve what I want, but it's clearly not something I would do everywhere, it's too verbose and creating a component just for that feels like a "DIY" job.
You'll note that I use the
leftSectionfor the icon, so I also need to handle the padding dynamically...What would be great, would be an attribute like
contentVisibleFromorchildrenVisibleFromaccepting aMantineSizeand handling the other aspects like padding whenleftSectionis passed automatically.Eventually the attribute
contentVisibleFromcould also be implemented in other components that accept children if it does not affect the performance.This would allow developers to build UI that are more dynamic (compact vs complete).
Having to choose between a Button or an ActionIcon to handle that is kind of extreme and also not very useful since they do not render with the same size (button with size=lg is different than ActionIcon with size=lg).
Beta Was this translation helpful? Give feedback.
All reactions