Input Group
Forms · InputGroup, Icon, Button
A text field with affixes inside one outline: a protocol before a domain, a currency or unit, a fixed email domain, a search icon, a unit select or a copy button.
startandendtake text, anIconor a control. Text affixes are read with the field (aria-describedby); controls keep their own names and are reached with Tab.- Takes the props of
TextField(label,hint,error,value,onChange,inputMode…).childrenreplaces the built-in input with your own control (give itclassName="tf-input"). - The outline shows hover, focus and errors for the whole group; on touch screens the text is 16px so iOS does not zoom.
https://
Without www@acme.com
€per month
Props
InputGroup
| Prop | Type | Notes |
|---|---|---|
start? | ReactNode | Before the input: text ("https://", "€") is read with the field; an `Icon`, a `Select` or a `Button` sits in the group as it is. |
end? | ReactNode | After the input: text ("@acme.com", "kg"), an icon or a control (copy, unit select …). |
children? | ReactNode | Your own control instead of the built-in input (it should carry `className="tf-input"`). |
label? | string | |
hint? | string | |
error? | string |
Icon
| Prop | Type | Notes |
|---|---|---|
name | IconName | Required |
size? | number | |
label? | string | |
className? | string | |
style? | CSSProperties | Inline style on the root element. |
Button
| Prop | Type | Notes |
|---|---|---|
variant? | "primary" | "secondary" | "soft" | "ghost" | "danger" | "danger-solid" | |
size? | "md" | "sm" | |
icon? | IconName | |
iconRight? | IconName | |
disabled? | boolean | |
type? | "button" | "submit" | "reset" | |
onClick? | (e: MouseEvent<HTMLButtonElement>) => void | |
children? | ReactNode | |
asChild? | boolean | Render the single child element (a link, a router Link) with the button's look instead of a <button>. |
id? | string | |
name? | string | Form field name and value, sent with the form when this button submits it. |
value? | string | |
form? | string | The id of the form this button belongs to, when it sits outside it. |
title? | string | |
tabIndex? | number | |
autoFocus? | boolean | |
aria-label? | string | |
aria-labelledby? | string | |
aria-describedby? | string | |
aria-expanded? | boolean | "true" | "false" | For disclosure and menu triggers: whether what the button controls is open. |
aria-controls? | string | |
aria-haspopup? | boolean | "true" | "false" | "menu" | "listbox" | "tree" | "grid" | "dialog" | |
aria-pressed? | boolean | "true" | "false" | "mixed" | For toggle buttons. |
aria-current? | boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |