Skip to content
🌏 Translated with the assistance of DeepSeek and ChatGPT

Composite Input Controls: Input Group

Used to combine various input controls and buttons together.

Basic Usage

Combines various input controls and buttons. Currently supported components:

  • Input
  • InputNumber
  • InputTag
  • AutoComplete
  • Select
  • Button
  • InputGroupLabel
.ini
<template>
	<px-space direction="vertical">
		<px-input-group>
			<px-input-group-label>
				<IconSearch></IconSearch>
			</px-input-group-label>
			<px-input placeholder="Please input"> </px-input>
			<px-button>Search</px-button>
		</px-input-group>
		<px-input-group>
			<px-input placeholder="Please input file name"> </px-input>
			<px-input-group-label> .ini </px-input-group-label>
		</px-input-group>
		<px-input-group>
			<px-input placeholder="Please input"> </px-input>
			<px-input-number placeholder="Please input" :default-value="0"> </px-input-number>
		</px-input-group>
	</px-space>
</template>
<script setup lang="ts">
import { IconSearch } from '@pixelium/web-vue/icon-hn/es'
</script>
<style lang="css" scoped>
.px-input,
.px-input-number {
	width: 320px;
}
</style>

Rounded Borders

The shape property controls the overall shape.

borderRadius sets the button corner radius; it takes precedence over shape and behaves like the CSS border-radius property.

Due to limited time and resources, custom rounded corners still need refinement, but overall usability is not affected.

<template>
	<px-space direction="vertical">
		<px-input-group shape="round">
			<px-input-group-label>
				<IconSearch></IconSearch>
			</px-input-group-label>
			<px-input placeholder="Please input"> </px-input>
			<px-button>Search</px-button>
		</px-input-group>
		<px-input-group :border-radius="[20, 16, 20, 16]">
			<px-input-group-label>
				<IconSearch></IconSearch>
			</px-input-group-label>
			<px-input placeholder="Please input"> </px-input>
			<px-button>Search</px-button>
		</px-input-group>
	</px-space>
</template>
<script setup lang="ts">
import { IconSearch } from '@pixelium/web-vue/icon-hn/es'
</script>
<style lang="css" scoped>
.px-input {
	width: 320px;
}
</style>

Control Sizes

The size property controls the dimensions of the controls.

<template>
	<px-space direction="vertical">
		<px-input-group size="small">
			<px-input-group-label>
				<IconBolt></IconBolt>
			</px-input-group-label>
			<px-input-number placeholder="Please input number" :default-value="0"> </px-input-number>
			<px-button>Confirm</px-button>
		</px-input-group>
		<px-input-group>
			<px-input-group-label>
				<IconBolt></IconBolt>
			</px-input-group-label>
			<px-input-number placeholder="Please input number" :default-value="0"> </px-input-number>
			<px-button>Confirm</px-button>
		</px-input-group>
		<px-input-group size="large">
			<px-input-group-label>
				<IconBolt></IconBolt>
			</px-input-group-label>
			<px-input-number placeholder="Please input number" :default-value="0"> </px-input-number>
			<px-button>Confirm</px-button>
		</px-input-group>
	</px-space>
</template>

<script setup lang="ts">
import { IconBolt } from '@pixelium/web-vue/icon-hn/es'
</script>

<style lang="css" scoped>
.px-input-number {
	width: 320px;
}
</style>

Disabled State

The disabled attribute applies a disabled state to all child controls.

<template>
	<px-input-group disabled>
		<px-input placeholder="Please input"> </px-input>
		<px-input-number placeholder="Please input" :default-value="0"> </px-input-number>
	</px-input-group>
</template>
<style lang="css" scoped>
.px-input,
.px-input-number {
	width: 320px;
}
</style>

API

InputGroupProps

AttributeTypeOptionalDefaultDescriptionVersion
borderRadiusNumberOrPercentage | NumberOrPercentage[]True0.0.2
shape'rect' | 'round'True'rect'Component shape, overrides the shape of child components; rounding only affects the outer borders on both sides of the child components.0.0.3
size'medium' | 'large' | 'small'True'medium'Component size, overrides the size of child components.0.0.2
disabledbooleanTruefalseWhether to disable.0.0.2
readonlybooleanTruefalseWhether the input-group is readonly.0.0.3
pollSizeChangebooleanTruefalseEnables polling for component size changes. This also affects the property of the same name in data input components that are child components.0.1.0

InputGroupSlots

SlotParameterDescriptionVersion
defaultComponents to be grouped.0.0.2

InputGroupLabelProps

AttributeTypeOptionalDefaultDescriptionVersion
backgroundColorstringTrueBackground color. Supports CSS-like strings such as 'rgb(r, g, b)' and 'rgba(r, g, b, a)', as well as 3-, 4-, 6-, and 8-digit hexadecimal values.0.0.2
borderRadiusNumberOrPercentage | NumberOrPercentage[]True0.0.2
shape'rect' | 'round'True'rect'Component shape.0.0.3
size'medium' | 'large' | 'small'True'medium'Component size.0.0.2
pollSizeChangebooleanTruefalseEnables polling for component size changes. This may impact performance. It is typically used to resolve abnormal canvas rendering that occurs when the component's size is affected by its container element.0.1.0

InputGroupLabelSlots

SlotParameterDescriptionVersion
defaultLabel content.0.0.2

NumberOrPercentage

ts
export type NumberOrPercentage = number | `${number}%`