Skip to content

Latest commit

 

History

History
executable file
·
34 lines (30 loc) · 1.3 KB

Icon.md

File metadata and controls

executable file
·
34 lines (30 loc) · 1.3 KB

icon-textbox-headref

Icon Textbox

Icons can be easily added to the NativeBase Textbox. To do so, include an icon within the <Item>.
The icons render in the order of its definition within Item.

Preview ios icon-textbox-headref Preview android icon-textbox-headref

Syntax

import React, { Component } from 'react';
import { Container, Header, Content, Item, Input, Icon } from 'native-base';
export default class IconTextboxExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content>
          // Text input box with icon aligned to the left
          <Item>
            <Icon active name='home' />
            <Input placeholder='Icon Textbox'/>
          </Item>
          // Text input box with icon aligned to the right
          <Item>
            <Input placeholder='Icon Alignment in Textbox'/>
            <Icon active name='swap' />
          </Item>
        </Content>
      </Container>
    );
  }
}