npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@atom_design/input

v1.0.0

Published

A versatile React Native input component supporting text, select, multiselect, chips, and search. Part of the Atom Design System.

Readme

@atom_design/input

A versatile React Native input component supporting multiple input types including text, select, multiselect, chips, and search. Part of the Atom Design System.

npm version license

Features

  • 📝 Multiple Types - Text, select, multiselect, chips, search, withButton
  • 🔍 Searchable Dropdown - Filter options with search
  • 🏷️ Chips Input - Add/remove tags dynamically
  • 🎨 Customizable - Style all elements with custom props
  • Accessible - Full screen reader support
  • Optimized - Memoized callbacks for performance
  • 💪 TypeScript - Full type definitions included

📦 Installation

npm install @atom_design/input
# or
yarn add @atom_design/input

Peer Dependencies

npm install react react-native prop-types react-native-vector-icons

Note: Make sure to follow the react-native-vector-icons installation guide for your platform.


🚀 Basic Usage

import React, { useState } from 'react';
import { View } from 'react-native';
import Input from '@atom_design/input';

const App = () => {
  const [name, setName] = useState('');

  return (
    <View style={{ flex: 1, padding: 20 }}>
      <Input
        type="text"
        label="Your Name"
        placeholder="Enter your name"
        value={name}
        onChangeText={setName}
      />
    </View>
  );
};

export default App;

🧩 Input Types

Text Input

<Input
  type="text"
  label="Email"
  placeholder="Enter email"
  leftIcon="email"
  value={email}
  onChangeText={setEmail}
/>

Select Dropdown

<Input
  type="select"
  label="Country"
  placeholder="Select country"
  options={[
    { label: 'United States', value: 'us' },
    { label: 'Canada', value: 'ca' },
    { label: 'United Kingdom', value: 'uk' },
  ]}
  value={country}
  onChangeText={setCountry}
/>

Multi-Select

<Input
  type="multiselect"
  label="Skills"
  placeholder="Select skills"
  options={[
    { label: 'JavaScript', value: 'js' },
    { label: 'TypeScript', value: 'ts' },
    { label: 'React', value: 'react' },
  ]}
  value={skills}
  onChangeText={setSkills}
/>

Searchable Select

<Input
  type="selectWithSearch"
  label="City"
  placeholder="Search city"
  options={cities}
  value={selectedCities}
  onChangeText={setSelectedCities}
/>

Chips Input

<Input
  type="chips"
  label="Tags"
  chips={tags}
  onAddChip={(chip) => setTags([...tags, chip])}
  onRemoveChip={(chip) => setTags(tags.filter(t => t !== chip))}
/>

Input with Button

<Input
  type="withButton"
  label="OTP Verification"
  placeholder="Enter OTP"
  value={otp}
  onChangeText={setOtp}
  buttonProps={{
    title: 'Verify',
    onPress: handleVerify,
  }}
/>

📋 Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | type | string | 'text' | Input type: text, select, multiselect, selectWithSearch, chips, withButton | | placeholder | string | - | Placeholder text | | value | string \| array | - | Current value | | onChangeText | function | - | Change handler | | disabled | boolean | false | Disable input | | leftIcon | string | - | Left icon name | | rightIcon | string | - | Right icon name | | options | Option[] | [] | Options for select types | | buttonProps | ButtonProps | {} | Button config for withButton | | label | string | - | Label above input | | error | string | - | Error message | | chips | string[] | [] | Chips for chips type | | onAddChip | function | - | Add chip callback | | onRemoveChip | function | - | Remove chip callback | | containerStyle | ViewStyle | - | Outer container style | | inputStyle | ViewStyle | - | Input container style | | labelStyle | TextStyle | - | Label style | | errorStyle | TextStyle | - | Error text style | | testID | string | - | Test ID |


🎨 Available Icons

Uses MaterialIcons from react-native-vector-icons. Common shortcuts:

| Shortcut | MaterialIcons Name | |----------|-------------------| | search | search | | email | email | | send | send | | close | close | | check | check | | eye | visibility | | eye-off | visibility-off | | lock | lock | | user | person | | phone | phone | | calendar | calendar-today |

You can also use any valid MaterialIcons name directly.


🧪 Test Screen Example

import React, { useState } from 'react';
import { SafeAreaView, ScrollView, Text, StyleSheet } from 'react-native';
import Input from '@atom_design/input';

const options = [
  { label: 'Apple', value: 'apple' },
  { label: 'Banana', value: 'banana' },
  { label: 'Cherry', value: 'cherry' },
  { label: 'Orange', value: 'orange' },
  { label: 'Mango', value: 'mango' },
];

const InputTestScreen = () => {
  const [text, setText] = useState('');
  const [email, setEmail] = useState('');
  const [selected, setSelected] = useState('');
  const [multiSelected, setMultiSelected] = useState([]);
  const [searchSelected, setSearchSelected] = useState([]);
  const [chips, setChips] = useState(['React', 'Native']);
  const [otp, setOtp] = useState('');

  return (
    <SafeAreaView style={styles.container}>
      <ScrollView contentContainerStyle={styles.content}>
        <Text style={styles.header}>@atom_design/input</Text>

        {/* Text Input */}
        <Input
          type="text"
          label="Name"
          placeholder="Enter your name"
          value={text}
          onChangeText={setText}
        />

        {/* With Icon */}
        <Input
          type="text"
          label="Email"
          placeholder="Enter email"
          leftIcon="email"
          value={email}
          onChangeText={setEmail}
        />

        {/* Disabled */}
        <Input
          type="text"
          label="Disabled Input"
          placeholder="Cannot edit"
          disabled
        />

        {/* With Error */}
        <Input
          type="text"
          label="Password"
          placeholder="Enter password"
          leftIcon="lock"
          error="Password is required"
        />

        {/* Select */}
        <Input
          type="select"
          label="Select Fruit"
          placeholder="Choose one"
          options={options}
          value={selected}
          onChangeText={setSelected}
        />

        {/* Multiselect */}
        <Input
          type="multiselect"
          label="Select Multiple"
          placeholder="Choose fruits"
          options={options}
          value={multiSelected}
          onChangeText={setMultiSelected}
        />

        {/* Searchable Select */}
        <Input
          type="selectWithSearch"
          label="Search & Select"
          placeholder="Search fruits"
          options={options}
          value={searchSelected}
          onChangeText={setSearchSelected}
        />

        {/* Chips */}
        <Input
          type="chips"
          label="Tags"
          chips={chips}
          onAddChip={(chip) => {
            if (!chips.includes(chip)) {
              setChips([...chips, chip]);
            }
          }}
          onRemoveChip={(chip) => setChips(chips.filter(c => c !== chip))}
        />

        {/* With Button */}
        <Input
          type="withButton"
          label="OTP"
          placeholder="Enter OTP"
          value={otp}
          onChangeText={setOtp}
          buttonProps={{
            title: 'Verify',
            onPress: () => console.log('OTP:', otp),
          }}
        />
      </ScrollView>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#f5f5f5',
  },
  content: {
    padding: 20,
  },
  header: {
    fontSize: 24,
    fontWeight: 'bold',
    textAlign: 'center',
    marginBottom: 24,
    color: '#333',
  },
});

export default InputTestScreen;

📝 TypeScript

Full TypeScript support included:

import Input, { Option, InputProps } from '@atom_design/input';

const options: Option[] = [
  { label: 'Option 1', value: 'opt1' },
  { label: 'Option 2', value: 'opt2' },
];

const MyInput: React.FC = () => {
  const [value, setValue] = useState<string>('');

  return (
    <Input
      type="select"
      label="Choose"
      options={options}
      value={value}
      onChangeText={(val) => setValue(val as string)}
    />
  );
};

♿ Accessibility

The Input component includes full accessibility support:

  • All interactive elements have proper accessibilityRole
  • Labels and hints for screen readers
  • Focus management in dropdowns
  • Live region announcements for errors

👤 Author

Atom Design Team


📄 License

MIT © Atom Design