Socket
Socket
Sign inDemoInstall

@highlight-ui/input

Package Overview
Dependencies
29
Maintainers
10
Versions
154
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @highlight-ui/input

Input UI component for the Personio UI Library


Version published
Weekly downloads
4.5K
increased by18.4%
Maintainers
10
Created
Weekly downloads
 

Readme

Source

npm personio.design storybook.personio.design

@highlight-ui/input

Installation

Using npm:

npm install @highlight-ui/input

Using yarn:

yarn add @highlight-ui/input

Using pnpm:

pnpm install @highlight-ui/input

In your (S)CSS file:

@import url('@highlight-ui/input');

Once the package is installed, you can import the library:

import { Input, TextArea } from '@highlight-ui/input';

Performance Tips

The Input component depends on imask.js, which is a relatively heavy dependency. This component's package is tree shakeable, if you do not need the input masking functionalities you can import the TextInput component instead of the Input component.

import { TextInput } from '@highlight-ui/input';

If you only need the masking functionalities of the component, you can import the MaskedInput component:

import { MaskedInput } from '@highlight-ui/input';

Usage

import React from 'react';
import { Input } from '@highlight-ui/input';

export default function InputExample() {
  return <Input name="map" color="input-critical" type="light" />;
}

Props 📜

Input

The InputProps extends the HTMLInputElement types

PropTypeRequiredDefaultDescription
disabledbooleanNofalseDisables the input element
classNamestringNoSets a class name to the component's root element
inputClassNamestringNoAllows providing a custom class name to the input element
outline"default", "warning", "error"NodefaultSets the color of the input's border
focusedbooleanNofalseFocuses the underlying input element
prefixReact.ReactNodeNoRenders the passed element on the left side of the input
prefixVariant"opaque", "transparent"NoApplies the specified style to the prefix element's container
suffixReact.ReactNodeNoRenders the passed element on the right side of the input
containerRefReact.Ref<HTMLDivElement>NoPasses a ref to the input's container element
maskOptionsMaskOptionsNoFunction which accepts locale and returns an imaskjs configuration object used for creating an IMask instance which will control the input element
onMaskAccept(e: MaskEvent) => voidNoSets a callback for when an event is fired on input changes allowed by the mask. This prop only works with maskOptions provided.
onMaskComplete(e: MaskEvent) => voidNoSets a callback for when an event is fired on input completion defined by the mask. This prop only works with maskOptions provided.

TextArea

The TextArea extends the HTMLTextAreaElement types

PropTypeRequiredDefaultDescription
disabledbooleanNofalseDisables the text area element
outline"default", "warning", "error"NodefaultSets the color of the text area's border
containerRefReact.Ref<HTMLDivElement>NoPasses a ref to the input's container element

Contributing 🖌️

Please visit personio.design for usage guidelines and visual examples.

If you're interested in contributing, please visit our contribution page.

FAQs

Last updated on 23 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc