{"slug":"input-group","name":"InputGroup","category":"Form & Input","summary":"Joins an input with prefix and suffix addons inside one frame.","status":"stable","since":"0.2.0","import":"import { InputGroup } from '@elluzion/iv-ui';","usage":["`prefix` and `suffix` take snippets; keep the content short, such as a protocol, unit, or icon.","`size` applies to the frame; keep the inner control on the same size.","Use `disabled` on the group for a consistent dimmed frame, and on the control to block input."],"props":[{"name":"size","type":"'sm' | 'md' | 'lg'","default":"'md'","description":"Control size shared by the group and its addons.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[],"snippets":[{"name":"prefix","type":"Snippet","default":null,"description":"Content rendered before the input, such as a protocol or icon.","required":false,"bindable":false},{"name":"suffix","type":"Snippet","default":null,"description":"Content rendered after the input, such as a unit or button.","required":false,"bindable":false},{"name":"children","type":"Snippet","default":null,"description":"The input control.","required":true,"bindable":false}],"types":[],"manual":[],"tokens":["--iv_border","--iv_border-focus","--iv_border-hover","--iv_control-pad-x","--iv_control-pad-x-lg","--iv_control-pad-x-sm","--iv_cursor","--iv_disabled-opacity","--iv_ease-in-out","--iv_font-ui","--iv_foreground-dim","--iv_radius-sm","--iv_ring","--iv_ring-width","--iv_surface-elevated","--iv_surface-raised","--iv_text-body","--iv_text-body-sm","--iv_text-label","--iv_transition-base"],"cssHooks":["iv-addon","iv-control","iv-disabled","iv-input-group","iv-input-wrapper","iv-lg","iv-native-select","iv-prefix","iv-sm","iv-suffix","iv-textarea-wrapper","iv-trigger"],"accessibility":{"notes":["The group is a visual container only; label the inner control itself.","Focus styling is applied to the whole frame through `:focus-within`."]},"related":[{"title":"Input","summary":"A single-line text field with an optional label, helper, and error state.","url":"/components/input","kind":"Component"},{"title":"NativeSelect","summary":"A native select element with the library field treatment.","url":"/components/native-select","kind":"Component"},{"title":"Field","summary":"Labels a custom control and renders its helper or error message.","url":"/components/field","kind":"Component"},{"title":"Select","summary":"A custom listbox with search, multiple selection, and clearing.","url":"/components/select","kind":"Component"}],"examples":[{"id":"addons","title":"Addons","description":"A protocol prefix and a unit suffix around one input.","code":"<script lang=\"ts\">\n\timport { Input, InputGroup } from '@elluzion/iv-ui';\n\n\tlet host = $state('orbital');\n</script>\n\n<div class=\"field-row\">\n\t<InputGroup>\n\t\t{#snippet prefix()}<span>https://</span>{/snippet}\n\t\t<Input bind:value={host} aria-label=\"Host\" />\n\t\t{#snippet suffix()}<span>.dev</span>{/snippet}\n\t</InputGroup>\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 340px;\n\t}\n</style>"},{"id":"sizes","title":"Sizes","description":"`sm`, `md`, and `lg` keep the addons aligned with the control.","code":"<script lang=\"ts\">\n\timport { Input, InputGroup } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"stack\">\n\t<InputGroup size=\"sm\">\n\t\t{#snippet prefix()}<span>sm</span>{/snippet}\n\t\t<Input size=\"sm\" placeholder=\"Small\" aria-label=\"Small size\" />\n\t</InputGroup>\n\t<InputGroup>\n\t\t{#snippet prefix()}<span>md</span>{/snippet}\n\t\t<Input placeholder=\"Medium\" aria-label=\"Medium size\" />\n\t</InputGroup>\n\t<InputGroup size=\"lg\">\n\t\t{#snippet prefix()}<span>lg</span>{/snippet}\n\t\t<Input size=\"lg\" placeholder=\"Large\" aria-label=\"Large size\" />\n\t</InputGroup>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-md);\n\t\twidth: 100%;\n\t\tmax-width: 340px;\n\t}\n</style>"},{"id":"with-button","title":"With a button","description":"The suffix can hold an action instead of text.","code":"<script lang=\"ts\">\n\timport { Button, Input, InputGroup } from '@elluzion/iv-ui';\n\n\tlet query = $state('deploy logs');\n\tlet submitted = $state('');\n\n\tfunction submit() {\n\t\tsubmitted = query;\n\t}\n</script>\n\n<div class=\"stack\">\n\t<InputGroup>\n\t\t<Input bind:value={query} aria-label=\"Search\" placeholder=\"Search the archive\" />\n\t\t{#snippet suffix()}<Button size=\"sm\" variant=\"ghost\" onclick={submit}>Search</Button>{/snippet}\n\t</InputGroup>\n\t<p class=\"readout\">last search: {submitted || '—'}</p>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-sm);\n\t\twidth: 100%;\n\t\tmax-width: 380px;\n\t}\n\n\t.readout {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-sm);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"}],"markdown":"/components/input-group.md","page":"/components/input-group"}