Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-floating-label

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-floating-label

A floating label text input factory for tcomb-form-native

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-floating-label

A floating label factory to use with tcomb-form-native library.

Floating label

Install

npm i react-native-floating-label --save

Use 0.2.2 for RN>=0.25.

Usage

When configuring your tcomb-form-native Form, use the factory option to set as FloatingLabel:

import React, { View } from 'react-native'
import t from 'tcomb-form-native'
import FloatingLabel from 'react-native-floating-label'

const Form = t.form.Form
const Login = t.struct({
  email: t.String,
  password: t.String,
})

class App extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      value: {},
      options: {
        fields: {
          email: {
            factory: FloatingLabel,
          },
          password: {
            factory: FloatingLabel,
          },
        },
      },
    }
  }

  render () {
    return (
      <View style={{flex: 1}}>
        <Form ref='form'
          type={Login}
          value={this.state.value}
          options={this.state.options}
        />
      </View>
    )
  }
}

API

You can pass all the TextInput props, and an additional prop called errorPlaceholderTextColor which accepts a color string to change the placeholder color when a validation error occurs.

Author

Álvaro Medina Ballester. 2015.

amedina at apsl.net

License

MIT.

Keywords

FAQs

Package last updated on 15 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc