# @artifak/text-input

> Text input components which comprises typeos of text, tel, url, email, search and password.

Latest version **1.0.3** (published 2021-04-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @artifak/text-input
pnpm add @artifak/text-input
yarn add @artifak/text-input
bun add @artifak/text-input
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-04-07 |
| First published | 2021-01-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 129.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Julian Low |
| Maintainers | heyjules |

## Links

- npm: https://www.npmjs.com/package/@artifak/text-input
- Repository: https://github.com/heyjul3s/artifak
- Homepage: https://github.com/heyjul3s/artifak#readme
- Issues: https://github.com/heyjul3s/artifak/issues
- npm.io page: https://npm.io/package/@artifak/text-input

## Dependencies (1)

- [@artifak/component-generator](https://npm.io/package/@artifak/component-generator.md) ^2.0.4

## Recent versions

- 1.0.3 (latest) — 2021-04-07
- 1.0.2 — 2021-02-17
- 1.0.1 — 2021-01-12

## README

# `@artifak/text-input`

A text based input element generator.

## Installation

### Yarn

```sh
yarn add @artifak/text-input
```

### NPM

```sh
npm install @artifak/text-input
```

## Usage

```ts
import { createTextInputs } from '@artifak/text-input';

const inputs = {
  base: {
    styles: {
      width: '100%',
      border: '1px solid black',
      padding: ['1em']
    }
  },

  components: {
    InputSearch: {
      maxWidth: '300px',
      attrs: { type: 'search' }
    },

    InputUrl: {
      display: 'block',
      attrs: { type: 'url' }
    }
  }
};

type BasicUsageProps = {
  disabled?: boolean;
  placeholder?: string;
  onBlur?: () => void;
};

const { Base: InputText, InputSearch, InputUrl } = createTextInputs<
  typeof inputs.components,
  BasicUsageProps
>(inputs.base, inputs.components);

export function BasicUsage() {
  const onBlur = (text: string) => () => {
    console.log('Blur', text);
  };

  return (
    <>
      <InputText onBlur={onBlur('Hello')} />
      <InputSearch />
      <InputUrl />
    </>
  );
}
```

---
_Source: https://npm.io/package/@artifak/text-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
