Skip to content

Latest commit

 

History

History
executable file
·
213 lines (203 loc) · 7.25 KB

Form.md

File metadata and controls

executable file
·
213 lines (203 loc) · 7.25 KB

Form

NativeBase makes use of List to design Forms that include group of related input components. Include any combination of NativeBase components to make up your form.
Input is a NativeBase component built on top of React Native's TextInput. A foundational component for inputting text into the app via a keyboard. Item component wrapper around it that apply specific styles.

Props provide configurability for several features, such as auto-correction, auto-capitalization, placeholder text, and different keyboard types, such as a numeric keypad.
Provides a number of attributes that follows styling and interaction guidelines for each platform, so that they are intuitive for users to interact with.

Replacing Component:

Contents:

Preview ios Form Preview android Form

Syntax

{% codetabs name="React Native", type="js" -%} import React, { Component } from 'react'; import { Container, Header, Content, Form, Item, Input } from 'native-base'; export default class FormExample extends Component { render() { return (

); } } {%- language name="Vue Native", type="vue" -%} {%- endcodetabs %}

Configuration

Property Default Option Description
fixedLabel true boolean Label is fixed to the left of Input and does not hide when text is entered.
floatingLabel true boolean Label that animates upward when input is selected and animates downward when input is erased.
inlineLabel - boolean Label placed to the left of input element and does not hide when text is entered. This can also be used along with placeholder.
stackedLabel - - Places the label on top of input element which appears like a stack. This can also be used along with placeholder.
bordered - - Includes border with the textbox
rounded - - Includes rounded border with the textbox.
regular - - Includes rectangluar border with the textbox.
underline true - Includes underline border with the textbox
disabled - - Disables inputting data
placeholderLabel - - Renders the same way the TextInput does with the form styling of NativeBase
placeholder - - String that renders before text input is entered
last - - Styles last Item of the Form
error - - Border color of textbox for invalid input
success - - Border color of textbox for valid input
picker - - Styles picker field with Input

Note: Form in NativeBase is just a wrapper around the inputs and hence has no onSubmit function.