Skip to content

InlineInput

InlineInput

Wrap over the inline-input elements.

jsx
import InlineInput from 'intergalactic/inline-input';
<InlineInput />;
import InlineInput from 'intergalactic/inline-input';
<InlineInput />;

InlineInputProps

& {...}
NameTypeDescription
state"normal" | "valid" | "invalid"Visual state of inline input
loadingbooleanDisabled input and shows spinner instead of confirm control
disabledbooleanDisabled input and controls
onConfirm(value: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => voidFired with entered value when user clicks confirm control or hits `Enter` or `Space`
onCancel(prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => voidFired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
valuestringText value of input. Should be used with `onChange` property together
defaultValuestringInitial text value of input
autoFocusbooleanMakes component to catch browser focus on component mount
placeholderstringGray text displayed in empty input
onBlurBehavior"cancel" | "confirm" | "none"defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
localestring

InlineInput.Value

This component represents the native tag input and accepts all its properties, such as value and onChange.

jsx
import InlineInput from 'intergalactic/inline-input';
<InlineInput.Value />;
import InlineInput from 'intergalactic/inline-input';
<InlineInput.Value />;

InlineInputValueProps

& {...}
NameTypeDescription
idstringid attribute of input tag
autoFocusbooleanwhen `true`, element is focused immediately after mount
valuestringvalue of input tag
defaultValuestringuncontrolled value of input tag
onChange(value: string, event: React.ChangeEvent) => voidcallback invoked on every change of input tag value
state"normal" | "valid" | "invalid"visual state of component
loadingbooleanshows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
disabledbooleandisables interactive elements
placeholderstringgray text in empty input tag

InlineInput.Addon

The addon inside the container (most often it is an icon or short text) places the correct indent units depending on the size.

When you click on Addon, the focus shifts to the input. You can cancel this by returning the return false in the onClick handler.

jsx
import InlineInput from 'intergalactic/inline-input';
<InlineInput.Addon />;
import InlineInput from 'intergalactic/inline-input';
<InlineInput.Addon />;

InlineInput.ConfirmControl

The addon with hint tooltip and icon. By default is displayed with middle-size Check icon. Addon click triggers InlineInput onConfirm callback.

When loading property is provided to InlineInput, InlineInput.ConfirmControl icon replaced with spinner.

jsx
import InlineInput from 'intergalactic/inline-input';
<InlineInput.ConfirmControl />;
import InlineInput from 'intergalactic/inline-input';
<InlineInput.ConfirmControl />;

InlineInputConfirmControlProps

& {...}
NameTypeDescription
titlestringText of tooltip
iconReact.FCIcon component

InlineInput.CancelControl

The addon with hint tooltip and icon. By default is displayed with middle-size Close icon. Addon click triggers InlineInput onCancel callback.

jsx
import InlineInput from 'intergalactic/inline-input';
<InlineInput.CancelControl />;
import InlineInput from 'intergalactic/inline-input';
<InlineInput.CancelControl />;

InlineInputCancelControlProps

& {...}
NameTypeDescription
titlestringText of tooltip
iconReact.FCIcon component

Released under the MIT License.

Released under the MIT License.