input-group

Input Group

An input or textarea with addons beside, above or below it, such as a search icon, a unit or a button that submits.

Parts

PartFileDoes
InputGroupInputGroup.vueGroups an input with addons such as icons, buttons or text.
InputGroupAddonInputGroupAddon.vuePlaces an icon, text or button beside the input of its group.
InputGroupButtonInputGroupButton.vueLets the user act on the input of its group, such as submit it.
InputGroupInputInputGroupInput.vueLets the user enter a single line of text inside the group.
InputGroupTextInputGroupText.vueShows fixed text, such as a unit or prefix, inside the group.
InputGroupTextareaInputGroupTextarea.vueLets the user enter several lines of text inside the group.

Anatomy

<InputGroup>
  <InputGroupInput />
  <InputGroupAddon>
    <InputGroupButton />
  </InputGroupAddon>
</InputGroup>

Styling

All of Input Group’s styles live in input-group.json. New to styling in Frontic UI? How styling works →

Install

Installs with it
button
input
textarea
npm packages
class-variance-authority
reka-ui

Built from

API reference

InputGroup.vue

Groups an input with addons such as icons, buttons or text. Renders a <div>.

Props 4

PropTypeDefault
asChildbooleanfalse
asAsTag | Component'div'
classClassValue—
sizeInputGroupSize—

Data attributes 1

Data attributeValues
data-size'md' | 'sm'

Recipe input-group 2 groups

InputGroupAddon.vue

InputGroupButton.vue

InputGroupInput.vue

InputGroupText.vue

InputGroupTextarea.vue
Input Group

Gift message

1<!-- SPDX-License-Identifier: FSL-1.1-MIT AND MIT -->2<!-- Frontic UI © Frontic · Portions © 2023 unovue (shadcn-vue, MIT) · ui.frontic.com/license -->3<script setup lang="ts">4import { ref } from 'vue'5import {6  InputGroup,7  InputGroupAddon,8  InputGroupText,9  InputGroupTextarea,10} from '@/components/ui/input-group'11 12const limit = 20013const message = ref('')14</script>15 16<template>17  <InputGroup class="max-w-sm">18    <InputGroupTextarea19      v-model="message"20      :maxlength="limit"21      placeholder="Add a gift message"22      aria-label="Gift message" />23    <InputGroupAddon align="block-end">24      <InputGroupText class="ms-auto"25        >{{ message.length }}/{{ limit }}</InputGroupText26      >27    </InputGroupAddon>28  </InputGroup>29</template>
State