Text field

A text field is an input that allows a user to write or edit text.

Installation

Package installation information
Installyarn add @atlaskit/textfield
SourceBitbucket.org, (opens new window)
npm@atlaskit/textfield, (opens new window)
Bundleunpkg.com, (opens new window)

Props

Text field props

appearance

Description

Controls the appearance of the field. Subtle shows styling on hover. None prevents all field styling. Take care when using the none appearance as this doesn't include accessible interactions.

Type"subtle" | "standard" | "none"

className

Description

Class name to apply to the input element.

Typestring

elemAfterInput

Description

Element after input in text field.

Typestring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

elemBeforeInput

Description

Element before input in text field.

Typestring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

isCompact

Description

Applies compact styling, making the field smaller.

Typeboolean

isDisabled

Description

Sets the field as to appear disabled, people will not be able to interact with the text field and it won't appear in the focus order. Wherever possible, prefer using validation and error messaging over disabled fields for a more accessible experience.

Typeboolean

isInvalid

Description

Changes the text field to have a border indicating that its value is invalid.

Typeboolean

isMonospaced

Description

Sets content text value to appear monospaced.

Typeboolean

isReadOnly

Description

If true, prevents the value of the input from being edited.

Typeboolean

isRequired

Description

Set required for form that the field is part of.

Typeboolean

name

Description

Name of the input element.

Typestring

onChange

Description

Handler called when the inputs value changes.

Type(event: FormEvent<HTMLInputElement>) => void

onMouseDown

Description

Handler called when the mouse down event is triggered on the input element.

Type(event: MouseEvent<HTMLElement, globalThis.MouseEvent>) => void

placeholder

Description

Placeholder text to display in the text field whenever it is empty.

Typestring

ref

Description

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).

@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}

Typestring | Ref<unknown>

testId

Description

A testId prop is provided for specified elements, which is a unique string that appears as a data attribute data-testid in the rendered code, serving as a hook for automated tests.

Typestring

width

Description

Sets maximum width of input.

Typestring | number

HTML Input props

@atlaskit/textfield extends HTML Input, (opens new window) and supports the props that a nativeinput, (opens new window) element supports. The prop disabled is not supported, please use isDisabled instead.

Useful HTML input props

type

Description
No description.
Typestring
Was this page helpful?
We use this feedback to improve our documentation.
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License