Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

Components / Forms

Input Group

Compose a native input with attached actions and shared focus styling.

Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.

Interactive showcase

Install

This installs InputGroup and the action components used in the examples below.

Run in your project
bunx --bun @getweini/cli@latest add input-group icon-button button

Start with this example

Import the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.

Vue
<script setup lang="ts">
import { ref } from 'vue'
import IconButton from './components/ui/icon-button/IconButton.vue'
import Input from './components/ui/input/Input.vue'
import InputGroup from './components/ui/input-group/InputGroup.vue'

const url = ref('https://weini.app/project')
function copyUrl() {
  navigator.clipboard.writeText(url.value)
}
</script>
<template>
  <InputGroup>
    <Input v-model="url" aria-label="Share URL" />
    <template #end>
      <IconButton variant="ghost" label="Copy URL" @click="copyUrl">
        <svg aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor">
          <rect x="5" y="2" width="8" height="9" rx="1.5" />
          <path d="M3 5H2v9h8v-1" />
        </svg>
      </IconButton>
    </template>
  </InputGroup>
</template>

The inner control retains its native attributes. Actions are separate tab stops; give icon-only actions accessible labels.

When to use it

Copyable URL

Put a separate copy action beside a read-only URL.

Search action

Attach a submit button while leaving the input editable and native.

More examples

Share URL

The action has its own keyboard stop and name.

Share URL
<script setup lang="ts">
import { ref } from 'vue'
import IconButton from './components/ui/icon-button/IconButton.vue'
import Input from './components/ui/input/Input.vue'
import InputGroup from './components/ui/input-group/InputGroup.vue'

const url = ref('https://weini.app/team')
function copyUrl() {
  void navigator.clipboard.writeText(url.value)
}
</script>
<template>
  <InputGroup>
    <Input v-model="url" aria-label="Share URL" readonly />
    <template #end>
      <IconButton type="button" variant="ghost" label="Copy URL" @click="copyUrl">
        <svg aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor">
          <rect x="5" y="2" width="8" height="9" rx="1.5" />
          <path d="M3 5H2v9h8v-1" />
        </svg>
      </IconButton>
    </template>
  </InputGroup>
</template>

Search with submit

Keep native form submission on the attached button.

Search with submit
<script setup lang="ts">
import { ref } from 'vue'
import Button from './components/ui/button/Button.vue'
import Input from './components/ui/input/Input.vue'
import InputGroup from './components/ui/input-group/InputGroup.vue'

const query = ref('')
</script>
<template>
  <form action="/search">
    <label for="query">Search</label>
    <InputGroup size="md">
      <Input id="query" v-model="query" name="q" size="md" />
      <template #end><Button type="submit" size="md">Go</Button></template>
    </InputGroup>
  </form>
</template>

Complete API

Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.

InputGroup

Complete API for InputGroup
NameType or signatureDefaultWhat it does
sizepropControlSize | undefined"md"Choose the visual size. Medium is the usual default where available.
invalidpropboolean | undefinedNot setShow the invalid state; also provide a visible error message.
disabledpropboolean | undefinedNot setPrevent interaction and show the disabled state.
defaultslot() => unknownRequiredContent shown inside InputGroup.
startslot(() => unknown) | undefinedOptionalContent for the start area of InputGroup.
endslot(() => unknown) | undefinedOptionalContent for the end area of InputGroup.
Public type definitions
Public types
// packages/frameworks/vue/components/input-group/types.ts
import type { ControlSize } from '@getweini/vue/types'

export interface InputGroupProps {
  size?: ControlSize
  invalid?: boolean
  disabled?: boolean
}


// packages/frameworks/vue/dist/types/index.d.ts
export type { ButtonOptions, ButtonProps } from './button';
export type ControlSize = 'sm' | 'md' | 'lg';
export interface SelectOption<T = unknown> {
    label: string;
    value: T;
    disabled?: boolean;
}
/** Application-owned copy. Bind translated strings reactively when the locale changes. */
export interface ListboxMessages {
    /** Popup name when no aria-label or aria-labelledby is supplied. */
    listboxLabel: string;
    empty: string;
    clearSelection: string;
}
export interface ListboxProps<T> {
    options: readonly SelectOption<T>[];
    messages: ListboxMessages;
    id?: string;
    disabled?: boolean;
    required?: boolean;
    invalid?: boolean;
    name?: string;
    form?: string;
    placeholder?: string;
    size?: ControlSize;
    clearable?: boolean;
    gap?: number;
    /** Supply stable equality for object values. Values must be unique. */
    by?: (a: T, b: T) => boolean;
    /** Required for meaningful form submission of object values. */
    serialize?: (value: T) => string;
}


// packages/frameworks/vue/dist/types/button.d.ts
import type { Component } from 'vue';
/** Options shared by button implementations across frameworks. */
export interface ButtonOptions<Variant extends string = string, Size extends string = string> {
    variant?: Variant;
    size?: Size;
    disabled?: boolean;
    loading?: boolean;
    type?: 'button' | 'submit' | 'reset';
}
/** Vue-specific target options extend the reusable button contract. */
export interface ButtonProps<Variant extends string = 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive', Size extends string = 'sm' | 'md' | 'lg'> extends ButtonOptions<Variant, Size> {
    as?: 'button' | 'a' | Component;
    asChild?: boolean;
}

Implementation notes

  • Match the group, inner control, and attached button size. Set disabled or invalid on both the group and input when they share that state.
  • The field and actions use the same light Separator as SplitButton, with square inner corners. Focus highlights the current segment, and buttons fill the group's height.
  • Use IconButton for a square action segment. Copy feedback can change its icon without moving the divider.
  • The start and end slots may contain actions; each action remains independently focusable.

Accessibility and localization

  • Name the input and every attached action separately. Avoid putting an unlabeled icon button beside the field.

Source contract and editing guidance