Brickslab.Toolsv2.1.1

@brickslab./ui-webQuiz

Single-line or multiline text input with character counter and min/max length validation.

Single line

Multiline with counter

0/300

With min length hint

Min 50 characters0

Props

PropTypeDéfautRequisDescription
valuestringCurrent text value.
onChange(v: string) => voidCalled on every keystroke.
multilinebooleanfalseRenders a resizable textarea instead of an input.
minLengthnumberShows a min length hint below the input.
maxLengthnumberNative maxLength attribute + counter if showCount is true.
placeholderstringPlaceholder text.
showCountbooleanfalseShows character counter below the input.
disabledbooleanfalseDisables the input.
Override rapide

Tous les paramètres listés dans cette table sont overrideables via les props. Utilisez ce squelette comme point de départ.

<MyComponent
  value="..."
  onChange="..."
  multiline={false}
  minLength={0}
  maxLength={0}
  placeholder="..."
  showCount={false}
  disabled={false}
/>
valueonChangemultilineminLengthmaxLengthplaceholdershowCountdisabled

Usage

tsx
import { FreeTextQuestion } from "@brickslab./ui-web";

const [value, setValue] = useState("");

<FreeTextQuestion
  value={value}
  onChange={setValue}
  multiline
  placeholder="Describe your experience…"
  maxLength={500}
  showCount
/>