DocSpace-client/packages/shared/components/input-block
2024-05-22 14:44:43 +03:00
..
index.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
InputBlock.stories.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
InputBlock.styled.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
InputBlock.test.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
InputBlock.tsx Shared: fix ts and eslint problems 2024-05-22 14:44:43 +03:00
InputBlock.types.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
README.md Shared:Components:InputBlock: rewrite to typescript 2023-12-07 11:22:27 +03:00

InputBlock

InputBlock description

Usage

import { InputBlock } from "@docspace/shared/components";
import SearchReactSvgUrl from "PUBLIC_DIR/images/search.react.svg?url";
const mask = [/\d/, /\d/, "/", /\d/, /\d/, "/", /\d/, /\d/, /\d/, /\d/];
<InputBlock
  mask={mask}
  iconName={SearchReactSvgUrl}
  onIconClick={(event) => alert(event.target.value)}
  onChange={(event) => alert(event.target.value)}
>
  <Button
    size="base"
    isDisabled={false}
    onClick={() => alert("Button clicked")}
    label="OK"
  />
</InputBlock>

Properties

Props Type Required Values Default Description
autoComplete string - - - Used as HTML autocomplete property
className string - - - Accepts class
hasError bool - - - Indicates the input field has an error
hasWarning bool - - - Indicates the input field has a warning
iconColor string - - black Specifies the icon color
iconName string - - - Specifies the icon name
iconSize number - - Size icon
id string - - - Used as HTML id property
isAutofocussed bool - - - Focus the input field on initial render
isDisabled bool - - false Indicates that the field cannot be used (e.g not authorised, or changes not saved)
isIconFill bool - - false Determines if icon fill is needed
isReadOnly bool - - false Indicates that the field is displaying read-only content
mask array - - - input text mask
name string - - - Used as HTML name property
onBlur func - - - Called when field is blurred
onChange func - - - Called with the new value. Required when input is not read only. Parent should pass it back as value
onFocus func - - - Called when field is focused
onIconClick func - - Will be triggered whenever an icon is clicked
placeholder string - - - Placeholder text for the input
scale bool - - - Indicates the input field has scale
size string - base, middle, big, huge base Supported size of the input fields.
style obj, array - - - Accepts css style
type string - text, password text Supported type of the input fields.
value string - - Value of the input