Skip to content

BulkTextarea

BulkTextarea

jsx
import BulkTextarea from '@semcore/ui/bulk-textarea';
<BulkTextarea>
  <BulkTextarea.InputField/>
</BulkTextarea>;

InputFieldProps

{...} & {...}
NameTypeDescription
idstring Unique id
placeholderstring Placeholder for field
valuestring | string[] String to render in textarea. OnChanging value, it will go throw paste pipeline
onBlur(value: string | string[], e: ) => void This component doesn't have default onChange callback, because we think that you need only the result after every changes/fixes
size"m" | "l" Size of component
state"normal" | "valid" | "invalid" State for show errors or valid(green) borders
disabledboolean Flag for disabling field
readonlyboolean Flag for readonly field
minRowsnumber Min rows
maxRowsnumber Max rows
validateOn("blur" | "blurLine" | "paste")[] List of available points to validate value
lineValidation(line: string, lines: string[]) => {isValid: boolean; errorMessage: string } Function to validate line
commonErrorMessagestring Message for display error about whole field, not only one line. If set empty string, field will not have invalid state.
linesDelimitersstring[] Delimiters (event.key) for lines
maxLinesnumber Count of max lines in badge
pasteProps Paste props
lineProcessing(line: string, lines: string[]) => string Function for process line after it was blurred
onImmediatelyChange(lines: string[], value: string) => void Return lines from textarea immediately they changed (uses mutation observer on textarea node under the hood) Throttling may be required during processing this cb Internal

BulkTextareaProps

NameTypeDescription
valueInputFieldProps<string | string[]>["value"] The current value
onChangeInputFieldProps<string | string[]>["onBlur"] Callback triggered when the onBlur event is emmited
placeholderInputFieldProps<string | string[]>["placeholder"] Placeholder text
sizeInputFieldProps<string | string[]>["size"] Component size
stateInputFieldProps<string | string[]>["state"] State for show errors or valid(green) borders
disabledInputFieldProps<string | string[]>["disabled"] Defines whether the textarea is disabled
readonlyInputFieldProps<string | string[]>["readonly"] Defines whether the textarea is readonly
minRowsInputFieldProps<string | string[]>["minRows"] Minimum number of rows to display
maxRowsInputFieldProps<string | string[]>["maxRows"] Maximum number of rows to display
validateOnInputFieldProps<string | string[]>["validateOn"] An event when a validation occurs
lineValidationInputFieldProps<string | string[]>["lineValidation"] A function to valide the line
linesDelimitersInputFieldProps<string | string[]>["linesDelimiters"] Line delimeters
pastePropsInputFieldProps<string | string[]>["pasteProps"] Defines the props for paste action
maxLinesInputFieldProps<string | string[]>["maxLines"] Maximum number of allowed lines/values
lineProcessingInputFieldProps<string | string[]>["lineProcessing"] Function to process individual lines during input
errorsInputFieldProps<string | string[]>["errors"] List of errors
showErrorsboolean Defines whether to show errors or not

Released under the MIT License.

Released under the MIT License.