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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xsolla/xui-input

v0.172.2

Published

A cross-platform text input with label, error, icon, clear and validation support; works on web and React Native via `XUIProvider` themed contexts.

Readme

Input

A cross-platform text input with label, error, icon, clear and validation support; works on web and React Native via XUIProvider themed contexts.

Installation

npm install @xsolla/xui-input

Imports

import { Input } from '@xsolla/xui-input';
import type { InputProps } from '@xsolla/xui-input';

Quick start

const [value, setValue] = useState('');

<Input
  label="Email"
  value={value}
  onChangeText={setValue}
  placeholder="[email protected]"
/>;

API Reference

<Input>

| Prop | Type | Default | Description | | --- | --- | --- | --- | | value | string | — | Controlled value. | | placeholder | string | — | Placeholder shown when empty. | | onChange | (e: ChangeEvent<HTMLInputElement>) => void | — | Native change handler. | | onChangeText | (text: string) => void | — | Simplified change handler receiving the text. | | size | 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' | 'md' | Control size. | | disabled | boolean | false | Disable the input. | | label | string | — | Label rendered above the input. | | error | boolean | false | Apply error styling. | | errorMessage | string | — | Error message; also marks the input invalid. | | iconLeft | ReactNode | — | Icon on the left. | | iconRight | ReactNode | — | Icon on the right. | | iconRightSize | number \| string | — | Override the right-icon size. | | extraClear | boolean | false | Show a clear button when the input has a value. | | onRemove | () => void | — | Fired when the clear button is pressed. | | checked | boolean | false | Show a success indicator (suppressed when errorMessage is set). | | checkedIcon | ReactNode | <CheckCr /> | Override the checked icon. | | borderTopLeftRadius | number | — | Override top-left corner radius. | | borderTopRightRadius | number | — | Override top-right corner radius. | | borderBottomLeftRadius | number | — | Override bottom-left corner radius. | | borderBottomRightRadius | number | — | Override bottom-right corner radius. | | backgroundColor | string | — | Override the background colour. | | id | string | auto | HTML id; also wires up the label. | | aria-label | string | — | Accessible label when no visible label is present. | | testID | string | — | Test identifier. |

Input also accepts the standard InputHTMLAttributes (excluding size and onChange, which are redefined above).

Inherits ThemeOverrideProps (themeMode, themeProductContext).

Examples

Sizes

<Input size="xs" placeholder="Extra small" />
<Input size="sm" placeholder="Small" />
<Input size="md" placeholder="Medium" />
<Input size="lg" placeholder="Large" />
<Input size="xl" placeholder="Extra large" />

Icons

import { Search, Check } from '@xsolla/xui-icons';
import { Mail } from '@xsolla/xui-icons-base';

<Input iconLeft={<Search />} placeholder="Search..." />
<Input iconLeft={<Mail />} iconRight={<Check />} placeholder="Email" />

Clear button

const [value, setValue] = useState('Some text');

<Input
  value={value}
  onChangeText={setValue}
  extraClear
  onRemove={() => setValue('')}
  placeholder="Type something..."
/>;

Validation

const [email, setEmail] = useState('');
const error = email && !email.includes('@') ? 'Invalid email' : '';

<Input
  label="Email"
  value={email}
  onChangeText={setEmail}
  error={!!error}
  errorMessage={error}
  placeholder="[email protected]"
/>;

Disabled and success

<Input label="Disabled" value="Cannot edit" disabled />
<Input label="Username" value="johndoe" checked />

Custom border radius

<Input
  placeholder="Rounded"
  borderTopLeftRadius={20}
  borderTopRightRadius={20}
  borderBottomLeftRadius={20}
  borderBottomRightRadius={20}
/>

Accessibility

  • Renders a semantic <input> whose aria-labelledby points at the id of the rendered <label> element (rather than the standard <label htmlFor> pairing).
  • Error messages are linked through aria-describedby and announced via role="alert".
  • aria-invalid and aria-disabled reflect error and disabled state.
  • Pressing Escape blurs the input.