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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@synerise/ds-input

v0.24.14

Published

Input UI Component for the Synerise Design System

Downloads

1,534

Readme


id: input title: Input

Input UI Component

Input

Textarea

MaskedInput

API

Input

| Property | Description | Type | Default | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | ----------- | | addonAfter | The label text displayed after (on the right side of) the input field. | string\ReactNode | | | addonBefore | The label text displayed before (on the left side of) the input field. | string\ReactNode | | | allowClear | Allow to remove input content with clear icon | boolean | | | counterLimit | Maximum input length, if provided counter will be shown | number | - | | renderCustomCounter | render function to display custom char counter instead of counterLimit. counterLimit (max alowed chars) does not have to be defined. | (count: number) => ReactNode | - | | defaultValue | The initial input content | string | | | description | input description | string | - | | disabled | Whether the input is disabled. | boolean | false | | errorText | Error message, if provided input will be set in error state | string | - | | error | If provided input will be set in error state, without error message | boolean | - | | expandable | If true then user can switch to a multiline field if text overflows the input | boolean | - | | handleInputRef | The callback function that is triggered when Component is mounted. | function(ref) | - | | id | The ID for input | string | | | label | Input label | string | - | | onChange | Callback when user input | function(e) | | | onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | | prefix | The prefix icon for the Input. | string\ReactNode | | | resetMargin | Whether input should have margin reset | boolean | - | | resize | 'resize' CSS property passed to the input component | none / both / horizontal / vertical / initial / inherit | - | | size | The size of the input box. Note: in the context of a form, the large size is used. Available: large default small | string | default | | suffix | The suffix icon for the Input. | string\ReactNode | | | tooltip | Tooltip content | ReactNode | - | | tooltipConfig | Config of tooltip | TooltipProps | - | | type | The type of input, see: MDN(use Input.TextArea instead of type="textarea") | string | text | | value | The input content value | string | | | autoResize | 'resize' width of the input based on width of the text in input | AutoResizeProp (see below) | undefined |

AutoResizeProp

type AutoResizeProp = `boolean` | {
    minWidth: string; 
    maxWidth?: string; 
    stretchToFit?: boolean 
};

Setting stretchToFit: true will make the field stretch to fit the containing element. The component observes the width of the wrapper and adjusts the maxWidth accordingly.
Important if the Input is within a flex-item then there is necessary CSS that needs to be applied to the flex-item containers in order for the flex-item to grow to fill the allowed space, but at the same time not stretch the flex container (identical issue happens when text-overflow needs to happen inside a flex-item).

$flexItemSurroundingTheInput {
    min-width: 0;
    flex-grow: 1
}

See https://css-tricks.com/flexbox-truncated-text/ for more details.

MaskedInput

Same as Input api with additional props:

| Property | Description | Type | Default | | ---------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------- | | mask | The masking pattern to be applied to the input | string (https://github.com/insin/inputmask-core#pattern) | - | | placeholderChar | Customized placeholder character used to fill in editable parts of the pattern. | string | '_' | | formatCharacters | Customized format character definitions for use in the pattern. | Object (https://github.com/insin/inputmask-core#formatcharacters) | - |

InputGroup

| Property | Description | Type | Default | | -------- | ------------------------------------------------------------------------------------------------------- | ------- | ------- | | compact | Whether use compact style | boolean | false | | size | The size of Input.Group specifies the size of the included Input fields. Available: large default small | string | default |

TextArea

| Property | Description | Type | Default | | -------- | ------------------------------------------------------------------------------------------------------- | ------- | ------- | | autoSize | Autosizing the height to fit the content | { minRows: number; maxRows: number; } | - | | errorText | Error message, if provided textarea will be set in error state | string | - | | error | If provided textarea will be set in error state, without error message | boolean | - | | resize | 'resize' CSS property passed to the textarea component | none / both / horizontal / vertical / initial / inherit | - | | wrapperStyle | CSS properties passed to the textarea component wrapper | React.CSSProperties | - |