Components/Forms/Input Group
COMPONENT12.12

Input Group

Input, textarea or select joined with addons — icons, text, kbd hints — inside one bordered frame that owns focus and error states.


INSTALL

1pnpm dlx @sayagodev/mo add input-group

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/input-group.css";

EXAMPLES

Label & hint
This is a hint for the input group.
This field contains validation errors.
Icon addons
Text & select joins
https:// .dev
Total USD
Dims with its control
Kbd shortcuts
⌘K
⌘P
Press the shortcut from anywhere to open this filter.
Buttons in addons
Your connection is not secure.
@
Enter a valid handle.
Invalid hairlines
Enter a valid email address.
@ .dev
Textarea header/footer
script.js Line 1, Column 1 JavaScript
Spinner
⌘K
Validating…
Dropdown addon
Prompt & counter
Ask, search or chat...
54 / 280 characters Plain text

USAGE

1<div data-input-group>2  <span data-addon>https://</span>3  <input placeholder="example.com" />4  <span data-addon><kbd>⌘K</kbd></span>5</div>

API

NAMEKINDDESCRIPTION
[data-input-group]attributeSelects the component; aria-invalid lives here
[data-addon]attributeMuted addon strip beside/below the control
data-align="block-start/end"attributeFull-width addon rows above/below a textarea
[data-push]attributePushes trailing addon content to the far edge
--mo-input-group-*tokenHeight, radius, divider hooks

FILES

src/css/input-group.css
Install:mo add input-group

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--input--muted-foreground--radius--ring
Component hooks
--mo-input-group-addon-padding-x--mo-input-group-divider--mo-input-group-height--mo-input-group-radius

Preview

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.