question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to set the label and icon on opposite sides in fullWidth button

See original GitHub issue

Desired behaviour

I would like to be able to set an icon and label in a button with “fullWidth” enabled on opposite sides.

image

Current behaviour

Currently it is not possible to set the icon and label on opposite sides in button. If we set fullWidth to true, the button with the icon looks like this:

image

Suggested Solution

Just add a new property that will set margin-left / margin-right (depending on the position of the icon) icon to “auto”. This is just one of the possible solutions.

span[data-component="icon"] { margin-left: 'auto' }

<Button buttonType="primary" iconType="caret_down" iconPosition="after" fullWidth={isSmallScreen} spaceBetween={true} // <== new property to set it > text </Button>

CodeSandbox or Storybook URL

No response

Anything else we should know?

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ljemmocommented, Nov 2, 2022

@Parsium she’s more refactoring the component to reduce file memory so i think you can go ahead with the implementation of this feature request.

2reactions
ljemmocommented, Nov 1, 2022

@Parsium i’ve chatted with Lisa who is currently rebuilding this component in figma. She’s supporting the proposed solution from @KonradWroblewski and we’re happy to go ahead with his spec.

FYI this is for multi-action button and not a standard button.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Icon and Input on same line and full width
I want the Icon and Input to be on the same line and the Input to take up the rest of the width...
Read more >
Fullwidth Button – Enfold Documentation - Kriesi.at
Enable custom CSS class name support from Enfold theme options > Layout Builder and add a custom class name called “my-custom-fullwidth-button” to the...
Read more >
Icon button - Carbon Design System
Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
Read more >
Buttons - Menus and actions - Human Interface Guidelines
A button always includes a text label or a symbol (or interface icon) — and ... you can also configure the button to...
Read more >
Enhancing The Clickable Area Size - Ahmad Shadeed
On the right side, the button size is larger and closer to its sibling input element, which will make it easier and faster...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found