G
Tokens
TypographySpacingColorRadiusShadowMotion

Textarea

Label and hint


    <Textarea
      value={demoText.l}
      label="Exposure"
      hint="Light meter accuracy"
      id="description"
      onChange={() => {}}
    />
  

Rows


    <Stack gap="m">
      <Textarea id="rowsExample" rows={1} value={demoText.m} onChange={() => {}}/>
      <Textarea id="rowsExample2" rows={4} value={demoText.sl} onChange={() => {}}/>
    </Stack>
  

Max length


    () => {
      const [value, setValue] = useState(demoText.xl + demoText.l)
      return (
        <Textarea
          id="maxLengthExample"
          maxLength={700}
          value={value}
          onChange={e => setValue(e.target.value)}
        />
      )
    }
  

With error


    <Textarea
      id="errorExample"
      value={demoText.m}
      hasError
      errorMessage="Too short"
      onChange={() => {}}
    />
  

Read only and disabled


    <Stack gap="m">
      <Textarea
        id="isReadOnlyExample"
        value={demoText.l}
        isReadOnly
        onChange={() => {}}
      />

      <Textarea
        id="disabledExample"
        value={demoText.l}
        isReadOnly
        onChange={() => {}}
      />
    </Stack>


Background color


    <Box padding="l2" backgroundColor="background2" borderSide="all" radius="m">
      <Textarea
        backgroundColor="background"
        id="colorExample"
        onChange={() => {}}
      />
    </Box>
  

Textarea.Counter


    <Box padding="l2" backgroundColor="background3" borderSide="all" radius="m">
      <Textarea.Counter
        length={45}
        maxLength={100}
        backgroundColor="background"
      />
    </Box>
  

Props

Name
Type
Default
rows
number
3
value
string
placeholder
string
label
oneOfType
string
node
idREQUIRED
string
hasError
bool
errorMessage
string
isReadOnly
bool
isDisabled
bool
hint
oneOfType
string
node
maxLength
number
backgroundColor
oneOfType
Object.keys(vars.colors)
string