Input Group

Input Groups are convenience components for a grouping of related inputs. While each input within the group could be independent, the v-model on the group provides a convenient interface for determining the current state of the group.

Preview

Default

Input Groups are typically paired with a legend which identifies the group. If no legend is provided then it is expected that an aria-label will be given in order to provide an invisible label to screen readers. Each Input Group should contain one or more inputs which users can interact with.

Model

The Vue model can have one of the following types [String, Number, Boolean, Object]:

// default = null
const value = 'some value';

The Vue model is dependant on the child component(s) implementing the provided groupContext and calling the provided setGroupValue method which will handle updating the provided groupContext and Vue model in the parent.

import {
  DtInputMixin,
  DtGroupableInputMixin,
} from '@dialpad/dialtone/vue';

export default {
  name: 'MyInputElement',

  mixins: [DtInputMixin, DtGroupableInputMixin],

  computed: {
    groupValue () {
      return this.groupContext?.value;
    },

    inputListeners () {
      return {
        change: event => this.emitValue(event.target.value),
      };
    },
  },

  watch: {
    groupValue: {
      immediate: true,
      handler (newGroupValue) {
        if (this.hasGroup) {
          // update internal value when the input group value changes
          this.internalChecked = newGroupValue === this.value;
        }
      },
    },
  },

  methods: {
    emitValue (value) {
      if (value !== this.groupValue) {
        // update provided value if injected
        this.setGroupValue(value);

        this.$emit('update:modelValue', value);
      }
    },
  },
};

Variants

With Legend

With Slotted Legend

Disabled

With Validation Messages

With Validation Messages Hidden

Extending

If your input(s) require additional logic in order to be grouped then you can extend the Input Group using extends in your Vue SFC.

Example

<script>
import { DtInputGroup } from '@dialpad/dialtone/vue';

export default {
  name: "MyComponent",
  extends: DtInputGroup,
  ...
};
</script>

Vue API

import { DtInputGroup } from '@dialpad/dialtone-vue';

Slots

Name
Type
default

slot for Input Group Components

legend

slot for Input Group Legend

Props

Name
Default
Type
name required
string

The name of the input group

dataQaGroup
'input-group'
string

A data qa tag for the input group

dataQaGroupLegend
'input-group-legend'
string

A data qa tag for the input group legend

dataQaGroupMessages
'input-group-messages'
string

A data qa tag for the input group messages

disabled
false
"true" | "false"

Disables the input group

id
generated unique ID
string

The id of the input group

legend
''
string

The legend of the input group

legendChildProps
{}
object

A set of props that are passed into the legend element

legendClass
''
string|array|object

Used to customize the legend element

messages
[]
array

Validation messages

messagesChildProps
{}
object

A set of props that are passed into the messages container

messagesClass
''
string|array|object

Used to customize the messages container

showMessages
true
"true" | "false"

Show validation messages

value
null
string|number|boolean|object

The value of the input group

Events

Name
Type
update:modelValue
String | Number | Boolean | Object

Event fired to sync the modelValue prop with the parent component

Input Group documentation last updated Thursday, June 18, 2026