Skip to main content

InputGroup

The InputGroup component allows you to easily group two or more InputField components.

Import

// with @dhl-official/react-library:
import { DhlInputGroup } from "@dhl-official/react-library"
// with @dhl-official/ui-libraries/react-library:
import { DhlInputGroup } from "@dhl-official/ui-libraries/react-library"

Code

<DhlInputGroup>
<DhlInputField
changeEvent={() => {}}
variant={{
label: 'Label',
placeholder: 'Placeholder',
type: 'static'
}}
/>
<DhlInputField
changeEvent={() => {}}
variant={{
label: 'Label',
placeholder: 'Placeholder',
type: 'static'
}}
/>
</DhlInputGroup>

Interactive Demo

Migrating to DUIL 1.0

  • rightIcon only supports string, a path to the icon or data url for the icon
  • Rename disabled to isDisabled
  • Remove isBlock

Readme

Properties

PropertyAttributeDescriptionTypeDefault
addonaddonAn optional prop for the component to display prefix or suffix addon.{ type: "prefix" | "suffix"; label: string; colorVariant?: ColorVariants.gray | ColorVariants.white; leftIcon?: string; rightIcon?: string; clickEvent?: () => void; options?: DhlSelectionOptionType[]; optionClickEvent?: (o: DhlSelectionOptionType) => void; }undefined
dataClassNamedata-class-nameAn optional class name prop for the component.stringundefined
dataIddata-idAn optional prop. Gives a valid HTML ID attribute value for the component.string`dhl-input-group-${getRandomString()}`
dataTestiddata-testidAn optional prop. The test id attached to the component as a data-testid attribute.stringundefined
hasInnerValidationIconhas-inner-validation-iconAn optional flag to render a validation icon inside the input group. Requires *validation.type key to be passed. When prop is set to true, validation icon is *displayed inside the fieldset. Can be used together with validation message or *independently.booleanfalse
isDisabledis-disabledAn optional flag to define if the component is disabled.booleanfalse
layoutlayoutAn optional prop to control input sizing layout."equally" | "shifted"DHL_INPUT_GROUP_LAYOUT.EQUALLY
rightIconright-iconAn optional Url of the icon to the display to the right instead of Chevron`.stringundefined
rightIconClickEventright-icon-click-eventAn optional right icon click callback handler.(e: Event) => voidundefined
validationvalidationAn optional object to set-up a custom components validation state.{ type: Variants.warning | Variants.valid | Variants.invalid | Variants.note; message?: string; }undefined

Slots

SlotDescription
"unnamed"unnamed children slot intended for multiple DhlInputField components

Dependencies

Used by

Depends on

Graph


Built by DHL User Interface Library Team!