Go Main page
Go Main page

Web components

cover

components

Input

v.1.0.0 | Saturn

Usage

The name of the object of tokens to style the input component is INPUT_STYLES.

You can not change the name of the object of tokens.

Input component has one way to modify the styles:

  • Variant: modify the styles of the Input.

The structure of the INPUT_STYLES object is:

Variants and States

Variants can modify the styles for each inner state of the input. The inner states are:

12345678910
enum InputState {
  EMPTY
  ACTIVE
  FILLED
  ERROR_EMPTY
  ERROR_FILLED
  ERROR_FILLED_WITH_INFO
  ERROR_ACTIVE
  DISABLED_FILLED
  DISABLED_EMPTY

For each inner state the next tokens can be used:

12345678910
const INPUT_STYLES = {
  [VARIANT]: {
    [STATE]: {
      inputWrapperContainer?: CommonStyleType;
      topContentContainer?: CommonStyleType;
      input?: TypographyTypes;
      inputContainer?: CommonStyleType;
      inputIcon?: IconTypes;
      inputIconContainer?: CommonStyleType;
      inputIconContainerRight?: CommonStyleType;

Types

  • LABEL_TYPE
12345
enum LABEL_TYPE {
  STANDARD = 'STANDARD',
  OUTLINED = 'OUTLINED',
  FILLED = 'FILLED',
}
  • InputContentPosition
1234
enum InputContentPosition {
  INNER = 'INNER',
  OUT = 'OUT',
}

Example

input theme object example:

12345678910
const INPUT_STYLES = {
  [VARIANT]: {
    [STATE]: {
      inputWrapperContainer: {
        background_color: 'color',
        border_color: 'color',
      }
      inputIcon: {
        width: 'width',
        height: 'height',