1.0.5 • Published 8 months ago

@mackscript/react-native-float-label-input v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

react-native-float-label-input

A customizable React Native input component with a floating label animation.

Floating Label Input

Installation

npm install @mackscript/react-native-float-label-input

Usage

import React, { useState } from 'react';
import { View, SafeAreaView } from 'react-native';
import FloatingLabelInput from '@mackscript/react-native-float-label-input';

export default function App() {
  const [formData, setFormData] = useState({
    name: '',
    email: '',
    phone: '',
  });

  const handleChange = (key: string, value: string) => {
    setFormData((prev) => ({ ...prev, [key]: value }));
  };

  return (
    <SafeAreaView>
      <View style={{ margin: 20 }}>
        <FloatingLabelInput
          label='Full Name'
          value={formData.name}
          onChangeText={(text) => handleChange('name', text)}
        />
        <FloatingLabelInput
          label='Email'
          value={formData.email}
          keyboardType='email-address'
          onChangeText={(text) => handleChange('email', text)}
        />
        <FloatingLabelInput
          label='Phone Number'
          value={formData.phone}
          keyboardType='phone-pad'
          onChangeText={(text) => handleChange('phone', text)}
        />
      </View>
    </SafeAreaView>
  );
}

Props

PropTypeDefaultDescription
labelstringundefinedThe label text displayed above the input field.
labelColorstring#212529Color of the floating label.
editablebooleantrueWhether the input is editable.
borderColorstring#212529Border color of the input field.
inputFontSizenumber14Font size of the input text.
labelFontSizenumber16Font size of the floating label.
multilinebooleanfalseAllows multiple lines of input.
keyboardTypeKeyboardTypeOptionsdefaultDefines the keyboard type ("default", "numeric", "email-address", etc.).

Features

  • Floating label animation when focusing or typing
  • Customizable styles
  • Supports different keyboard types
  • Supports multiline input

License

MIT

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago