Installation
Section titled “Installation”- Package
@bigbang/ui- Import
import { InputGroup } from '@bigbang/ui';- Source
- InputGroup.tsx
- Storybook
- InputGroup · Playground
InputGroup is in the @bigbang/ui package.
import { InputGroup } from '@bigbang/ui';
<InputGroup label="Field label"> <InputGroup.Addon> <InputGroup.Text>https://</InputGroup.Text> </InputGroup.Addon> <InputGroup.Input value={value} onValueChange={setValue} /></InputGroup>;The part prop types are exported too: InputGroupAddonProps, InputGroupInputProps, InputGroupTextareaProps, InputGroupTextProps, InputGroupButtonProps.
labelRequired- Description
- The visible label, bound to the input or textarea with
<label>. A placeholder does not replace it. - Type
string
description- Description
- Help text under the group, linked with
aria-describedbybefore the error. - Type
ReactNode
error- Description
- When set, the group is invalid and the message is read with the control.
- Type
string
invalid- Description
- Marks the group invalid without a message, for example when the message is in an error summary.
- Type
boolean- Default
false
required- Description
- The value is required: the label gets
*with a visually hidden "zorunlu" or "required". Setrequiredon the input too. - Type
boolean- Default
false
necessityIndicator- Description
- Which fields the form marks:
'required'marks required fields,'optional'adds "(isteğe bağlı)" or "(optional)" to the others. - Type
'required' | 'optional'- Default
'required'
size- Description
- Height of the input row: 32, 36 or 40 px, as TextInput.
- Type
'sm' | 'md' | 'lg'- Default
'md'
disabled- Description
- Disables the control, the addons' look and the label; the value is not submitted.
- Type
boolean- Default
false
name- Description
- Field name used when the form is submitted.
- Type
string
className- Description
- Added to the root element; use it for layout only.
- Type
string
childrenRequired- Description
- One
InputGroup.InputorInputGroup.Textarea, andInputGroup.Addonparts in any order;alignplaces them. - Type
ReactNode
InputGroup.Input: Base UI Input; takes attributes such asvalue,defaultValue,onValueChange,requiredandinputMode.InputGroup.Textarea: takesrows,placeholder,value,defaultValueandonValueChange; it grows with its content fromrows.InputGroup.Addon:align(inline-startby default,inline-end,block-start,block-end) anddividerfor a line between a block addon and the control.InputGroup.Text: addon text.InputGroup.Button: a compact 24 px ghost button;childrenfor text (with an optionalicon), oriconwithlabelfor an icon-only button with a Tooltip. TakesonClickanddisabled.
Data attributes
Section titled “Data attributes”data-component="input-group": on the root element.data-part:box,addon,control,button.data-align: on an addon.