InputGroup

Combines related inputs for a form.

To implement InputGroup component into your project you’ll need to add the import:

import InputGroup from "@kiwicom/orbit-components/lib/InputGroup";
import InputField from "@kiwicom/orbit-components/lib/InputField";
import Select from "@kiwicom/orbit-components/lib/Select";

After adding import into your project you can use it simply like:

<InputGroup>
<InputField />
<Select />
</InputGroup>

Table below contains all types of the props available in InputGroup component.

NameTypeDefaultDescription
childrenReact.NodeThe content of the InputGroup, normally InputField or Select.
dataTeststringOptional prop for testing purposes.
errorReact.NodeThe error to display beneath the InputGroup. See Functional specs
flexstring or Array<string>"0 1 auto"The flex attribute(s) for children of the InputGroup. See Functional specs
helpReact.NodeThe help to display beneath the InputGroup.
labelTranslationThe label for the InputGroup. See Functional specs
onChangeevent => void \| PromiseFunction for handling onClick event. See Functional specs
onFocusevent => void \| PromiseFunction for handling onFocus event. See Functional specs
onBlurevent => void \| PromiseFunction for handling onBlur event. See Functional specs
sizeenum"normal"The size of the InputField. See Functional specs
spaceAfterenumAdditional margin-bottom after component. See this docs
size
"small"
"normal"
  • The error prop overwrites the help prop, due to higher priority.

  • Define error or help only for the InputGroup. Any error or help in InputField or Select won’t be displayed.

  • You can set up different flex attribute for every children, or use one for all. See flex property docs for more information.

  • The color of the label will turn into cloud shade when all children have some filled value.

  • If the passed children into the InputGroup won’t have any callbacks - either onChange, onFocus or onBlur, the passed callback of the InputGroup will be used.

  • Define size only for the InputGroup, it will set up the proper styling for everything automatically.