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.

How can I set some space between Input and Icon properly?

See original GitHub issue

I am new to both react native and react native elements and I have read react native elements documents as well as test some code provides in the docs but the result is not the same as shown in the document page. I have tried on this section and then this is the code I tried:

 <View>
     <Input
         placeholder='PASSWORD'
         style={{padding: 50}}
          // leftIcon={ <Icon name="lock" size={24} style={{padding:}}/> } // this one is working but imagine if I have some reason not to use <Icon/>
          leftIcon={{ type: 'font-awesome', name: 'lock' }} />
  </View>

Here is the result i got:

Screenshot_1570032226

The output look too bad compare to the one i saw on the documents. So, how can I set some space between icon and input?

I almost forget. i believe what shown on document(code, picture) should be relevant so we can easily copy and paste and furthermore, there should be more code example. I used to use bootstrap, this provide many example including form … And if this project could do that too, it would be much easier for new comer to learn and copycat. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
iRoachiecommented, Oct 4, 2019

Not as yet, we do have it planned for the next release. See https://github.com/react-native-elements/react-native-elements/issues/1962

1reaction
iRoachiecommented, Oct 3, 2019

This is a bug that’s to be fixed in 2.0.0, we didn’t fix it earlier cause it would’ve been a breaking change.

However, we have a prop called leftIconContainerStyle that you can use to remove the margin. See example https://snack.expo.io/@roach_iam/intelligent-pizza

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to give space between class "input-group" icon and textbox
1 Answer 1 ; type · "text" ; class · "form-control" ; placeholder · "Username" ; aria-describedby · "basic-addon1" ; style · "margin-right:...
Read more >
How to create more space between a button and text box in ...
You can add more space between a button and text box by using “margin” attribute. If you want to add right side more...
Read more >
Input - Lightning Design System
About Inputs#. You can style the HTML <input> element to align with the Salesforce brand by using the .slds-input class on the <input>...
Read more >
How to create gap or control the space between free text and ...
I'm trying to insert some space characters before my “title” input box to leave a gap. Would anyone know how best to do...
Read more >
Components - Bootstrap
Includes over 250 glyphs in font format from the Glyphicon Halflings set. ... Be sure to leave a space between the icon and...
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