3.1.1 • Published 15 days ago

@sikt/sds-input v3.1.1

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
15 days ago

@sikt/sds-input

Consume

npm i -s @sikt/sds-input

React

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

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

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-input");

Create custom markup:

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

15 days ago

3.1.0

1 month ago

3.0.2

2 months ago

3.0.1

6 months ago

3.0.0

7 months ago

2.0.0

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago