1.0.19 • Published 3 years ago

native-x-text-input v1.0.19

Weekly downloads
25
License
MIT
Repository
github
Last release
3 years ago

native-x-text-input

semantic-release

Input component for capturing text input from users.

Install

Yarn

yarn add native-x-text-input

NPM

npm install native-x-text-input

Usage

import { TextInput } from 'native-x-text-input'

function MyComponent() {
  return (
    <Stack>
      ...
      <TextInput
        label='Email'
        placeholder='Enter an email'
        rounded
        error='This input is not valid!'
      />
      ...
    </Stack>
  )
}

This component is compatible with native-x-form

import { TextInput } from 'native-x-text-input'
import { Form, FormInput } from 'native-x-form'

interface FormState {
  email?: string
}

function MyComponent() {
  const onChange = ({ state: { email }, isValid }: { state: FormState; isValid: boolean }) => {
    console.log({ email })
  }

  return (
    <Form<FormState> state={state} onChange={onChange}>
      ...
      <FormInput name='email' validators={[isInvalidEmail('This is invalid email!')]}>
        <TextInput label='Email' placeholder='Enter an email' rounded />
      </FormInput>
      ...
    </Form>
  )
}

API

PropertyDefault ValueUsage
label?: stringLabel for the input
placeholder?: stringPlaceholder text for the text input
multiline?: booleanSet true to allow more than one line for the input
rounded?: booleanfalseSet true to use rounded corners
error?: stringError message to show
autoCapitalization?: stringValid values are: 'none', 'words'
autoFocus?: booleanSet true to auto focus
disabled?: booleanSet true to disable input
password?: booleanSet true to use the input as secret input
numberOfLines?: numberNumber of lines to allow
icon?: ReactNodeIcon component to render with in the component
rightIcon?: ReactNodeIcon component to render at the right end of the component
fill?: booleanSet true to fill the container
width?: numberWidth of the text input
height?: numberHeight of the text input
errorColor?: string'error'One of the colors specified by theme provider

Automatic Release

Here is an example of the release type that will be done based on a commit messages:

Commit messageRelease type
fix: commentPatch Release
feat: commentMinor Feature Release
perf: commentMajor Feature Release
doc: commentNo Release
refactor: commentNo Release
chore: commentNo Release
1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago