Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 1.32 KB

FloatingLabel.md

File metadata and controls

35 lines (30 loc) · 1.32 KB

floating-label-headref

Floating Label

The floatingLabel property creates an Input component, whose Label animates upward when input is selected and animates downward when input is erased.

Preview ios floating-label-headref Preview android floating-label-headref

Syntax

import React, { Component } from 'react';
import { Container, Header, Content, Form, Item, Input, Label } from 'native-base';
export default class FloatingLabelExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content>
          <Form>
            <Item floatingLabel>
              <Label>Username</Label>
              <Input />
            </Item>
            <Item floatingLabel last>
              <Label>Password</Label>
              <Input />
            </Item>
          </Form>
        </Content>
      </Container>
    );
  }
}

When using floatingLabel, use getRef to get the reference of <Input/> component. Always wrap floatingLabel component with <Form/>.