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.

Make `iconSpacing` control `ButtonSpinner` margin

See original GitHub issue

Description

Currently iconSpacing property of Button component only controls the spacing between leftIcon / rightIcon and button text. It doesn’t control the spacing between ButtonSpinner and button text when isLoading={true}.

From my point of view, it should control it. Otherwise, there is a design shift when isLoading goes from false to true.

Problem Statement/Justification

Currently iconSpacing property of Button component only controls the spacing between leftIcon / rightIcon and button text. It doesn’t control the spacing between ButtonSpinner and button text when isLoading={true}.

Proposed Solution or API

Controling ButtonSpinner margin via iconSpacing property.

Alternatives

No response

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cschroetercommented, Nov 11, 2021
  1. Not necessarily. You can use any kind of React component
spinner?: React.ReactElement;
  1. ? What solution. Was just an proposal for a more flexible button api
    /**
     * The space between the button icon and label.
     * @type SystemProps["marginRight"]
     * @deprecated use spacing instead
     */
    iconSpacing?: SystemProps["marginRight"];
    
    /**
     * The space between each item in the button
     * @type SystemProps["margin"]
     */
    spacing?: SystemProps["margin"];
<Button spacing="4" isLoading loadingText="Loading" leftIcon={<SaveIcon />}>Save</Button>

When looking into the button api I think there is another inconsistency in the button api. The icon is placed using iconLeft and iconRight while the spinner is placed using spinnerPlacement. But I guess thats a different discussion.

1reaction
lcswillemscommented, Nov 10, 2021

@sohamsshah Here is a codesandbox: https://codesandbox.io/s/homepage-forked-6pmis?file=/src/App.tsx

This is the UI of “Search button” by default:

image

When you click, this is the UI:

image

You see that the spacing changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the spacing between desktop icons for ...
Then, please navigate to HKEY_CURRENT_USER - Control Panel - Desktop - WindowMetrics, then double-click on each of the IconSpacing (horizontal icon spacing) and ......
Read more >
Button - Chakra UI
Button component is used to trigger an action or event, such as submitting a form, opening a Dialog, canceling an action, or performing...
Read more >
How to get space between icon and label on button?
You can use the following custom CSS to add some margin to the right of the icon: .lotusBtn img { margin-right: 10px; }....
Read more >
How to modify Icon Spacing & Icon Size (Windows 10)
Download ZIP compressed " icon spacing.reg" file ▻ https://drive.google.com/open?id=1z3fi4uoNe7CEr2VIX6kRJ5aIswSMlqggDownload "Desktop Icons ...
Read more >
How to change icon spacing in Windows 10 - YouTube
Want to change the spacing of the icons on your Windows 10 desktop? I'll show you the range and how to do it...
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