4.1.1 • Published 27 days ago

@sikt/sds-input v4.1.1

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
27 days ago

@sikt/sds-input

Consume

npm i -s @sikt/sds-{form,input}

React

import { TextInput } from "@sikt/sds-input";
import "@sikt/sds-form/dist/index.css";
import "@sikt/sds-input/dist/index.css";

<TextInput label="Label" onChange={() => {}} value={value} />;

Input Component

The Input component is a flexible input field component designed to handle different types of inputs.

Available types

  • TextArea: Allows multi-line text input.
  • TextInput: Standard single-line text input.
  • NumberInput: Accepts numerical input.
  • EmailInput: Specifically designed for email input.
  • PasswordInput: Secured input for password entry.
  • TelInput: For entering telephone numbers.
  • SearchInput: Optimized for search functionality with a custom clear icon button.

SearchInput

The SearchInput features a custom clear icon button. Note that clearing the input field when pressing the Escape key is a built-in default feature.

It is important to note that in Firefox, clicking the clear button causes the SearchInput field to lose focus. However, this has been adressed by reassigning focus to the SearchInput using the useRef hook.

Stylesheets & custom markup

Import stylesheet:

@import url("@sikt/sds-form");
@import url("@sikt/sds-input");

Create custom markup:

<div class="sds-input">
  <label class="sds-input__label" for="nameInput">Name</label>
  <div class="sds-input__wrapper">
    <input class="sds-input__input" id="nameInput" type="text" />
  </div>
  <div class="sds-input__help-text">Enter your name</div>
</div>
4.0.5

3 months ago

4.0.4

3 months ago

4.1.0

2 months ago

4.0.3

4 months ago

4.1.1

27 days ago

4.0.2

8 months ago

4.0.1

9 months ago

3.1.2

1 year ago

4.0.0

10 months ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.2

1 year ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago