Skip to main content

Controls

The Control component provides styled form controls based on Bootstrap's form-control API. It supports native inputs, textareas, plain text mode, different sizes, file inputs, and all utility props inherited from Prime.

Import​

import { Form } from "@promethey/bsui";

Note

Badge inherits all utility props supported by the Prime component, including layout, spacing, typography, colors, borders, sizing, positioning, and other Bootstrap utility APIs.

Basic usage​

Input types​

Use the type prop to specify the native input type.

Textarea​

Set as="textarea" to render a multiline text control.

Use the rows prop to control the visible number of lines.

Sizes​

Use the size prop to change the visual size.

Disabled​

Use disabled to prevent user interaction.

Read only​

Use readOnly to display a value that cannot be edited.

Plain text​

Use plaintext to display form values without the default control styling.

File input​

Use type="file" to create a file selector.

Set multiple to allow selecting multiple files.

Controlled value​

Use value with React state to create a controlled component.

Default value​

Use defaultValue for uncontrolled inputs.

Complete example​

Combine different options with utility props.

Utility props​

All utility props provided by Prime are supported.

API​

Control​

PropTypeDefaultDescription
childrenReactNode—Content rendered inside the component.
as"input" | "textarea""input"Determines the underlying HTML element.
classNamestring | object—Additional CSS classes.
styleobject—Inline styles.
valuestring | numbernullControlled value of the input or textarea.
defaultValuestring | numbernullDefault uncontrolled value.
titlestringnullNative title attribute.
size"sm" | "lg"nullVisual size variant.
typestring"text"Native input type.
placeholderstringnullPlaceholder text.
rowsnumbernullNumber of visible textarea rows.
disabledbooleanfalseDisables user interaction.
readOnlybooleanfalseMakes the control non-editable.
plaintextbooleanfalseDisplays the value as plain text.
multiplebooleanfalseAllows multiple file selection.