Skip to main content

Starwind UI v1.16 is now available! With new popover and more components With new input-group, native-select, and popover components

Input Group

Installation

Usage

General Notes

The essential components are InputGroup, InputGroupAddon, and either InputGroupInput or InputGroupTextarea.

InputGroupText and InputGroupButton are helper components for labels, metadata, and actions.

Focus management: Keep InputGroupAddon after InputGroupInput or InputGroupTextarea in the DOM. Use align to control visual placement.

Align

inline-start

Use align="inline-start" to place content at the start of the field. This is the default alignment.

inline-end

Use align="inline-end" to place content at the end of the field.

block-start

Use align="block-start" to place a header row above the control.

Full Name
script.js

block-end

Use align="block-end" to place a footer row below the control.

USD
0/280

Examples

Icon

Text

$
USD
https://
.com
@company.com
120 characters left

Button

https://

Kbd

Ctrl+K

Spinner

Saving…

Textarea

Line 1, Column 1

script.js

API Reference

InputGroup

The root wrapper that handles group-level border, focus ring, and invalid state styling.

PropTypeDefault
classstring-
<InputGroup>
<InputGroupInput placeholder="Search..." />
<InputGroupAddon>
<Search />
</InputGroupAddon>
</InputGroup>

Additional Notes:

  • Accepts all standard HTML <div> attributes

InputGroupAddon

A flexible container for icons, text, buttons, and status indicators.

PropTypeDefault
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"
classstring-
<InputGroupAddon align="inline-end">
<Search />
</InputGroupAddon>

Additional Notes:

  • Place after the control in markup for proper focus behavior
  • Use inline-start/inline-end with InputGroupInput
  • Use block-start/block-end with InputGroupTextarea

InputGroupButton

An input-group-tuned button with compact sizing and no shadow.

PropTypeDefault
size"sm" | "icon-sm""sm"
variant"default" | "primary" | "secondary" | "outline" | "ghost" | "info" | "success" | "warning" | "error""ghost"
typestring"button"
classstring-
<InputGroupButton variant="secondary" size="icon-sm" aria-label="Copy">
<Copy />
</InputGroupButton>

Additional Notes:

  • Inherits remaining props from Button

InputGroupInput

Input replacement with input-group styles and focus-slot behavior pre-applied.

PropTypeDefault
size"sm" | "md" | "lg""md"
typestring"text"
classstring-
<InputGroupInput placeholder="Enter text..." />

Additional Notes:

  • Inherits all props from Input
  • Automatically applies data-slot="input-group-control"

InputGroupText

A helper text wrapper for prefixes, suffixes, and metadata labels.

PropTypeDefault
classstring-
<InputGroupText>@company.com</InputGroupText>

InputGroupTextarea

Textarea replacement with input-group styles and focus-slot behavior pre-applied.

PropTypeDefault
size"sm" | "md" | "lg""md"
classstring-
<InputGroupTextarea placeholder="Write a comment..." />

Additional Notes:

  • Inherits all props from Textarea
  • Automatically applies data-slot="input-group-control"

Changelog

v1.0.0

  • Initial release with starwind v1.16.0