Text Field

Displays a text field input with an optional slot for buttons and icons.

Import the component and piece the parts together.

TextField.Root

defaultValue

string | number

invalid

boolean

size

123

state

deprecated
disablednormalread-onlyinvalid

suppressPasswordManagers

boolean

type

numbersearchtimetexthiddentelurlemaildatedatetime-localmonthpasswordweek

value

string | number

variant

softclassicsurface

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

TextField.Slot

color

rubygraygoldbronzebrownyellowamberorangetomatoredcrimsonpinkplumpurplevioletirisindigobluecyantealjadegreengrasslimemintsky

gap

1234056789

pl

1234056789

pr

1234056789

px

1234056789

side

leftright

You can compose up to two Slot parts – one on the left, and one on the right. The Slots provide a default gap and padding for its contents.

You can use just the Root part if Slots are not needed.

Use the variant prop to control the visual style of the input.

Use the size prop to control the size of the input.

Use matching component sizes when composing Text Field with buttons. However, don’t use size 1 inputs with buttons – at this size, there is not enough vertical space to nest other interactive elements.

The state prop is deprecated, as the types of state it represents may not be mutually exclusive. Use disabled, readOnly or invalid instead.

The invalid prop indicates that the field’s value is invalid. Fields are styled as valid by default, though built-in client-side validation still applies. In a future version we may synchronize styled validation with the field’s internal validity state.

Dashboard

10 variants found

TextField in Payment Method Formdashboard
TextField in Oidc Connection Settings With Discoverydashboard
size 1 textfield in Configure Email Password Dialogdashboardstatic
<Form.Control asChild> <TextField.Root disabled={!watch('isPasswordHistoryEnabled')} max={10} min={1} name={field.name} size="1" style={{ width: 50 }} type="number" value={field.value} onBlur={(event) => { const value = event.target.value; field.onChange( value ? Math.max(Math.min(Number(value), 10), 1) : initialPasswordHistorySize, ); }} onChange={(event) => { const value = event.target.value; field.onChange( value ? Math.max(Math.min(Number(value), 10), 1) : '', ); }} onFocus={(event) => { event.target.select(); }} /> </Form.Control>
size=1
disabled textfield in Configure Workos Email Provider Dialogdashboard
disabled=true
disabled textfield in Edit Connection Group Dialogdashboard
disabled=true
size 2 textfield in Radar List Tabledashboard
size=2variant=surface
size 2 textfield in Json Path Selectordashboardstatic
<TextField.Root aria-hidden readOnly suppressPasswordManagers autoComplete="off" className={styles.triggerTextField} disabled={disabled} placeholder={placeholder} role="presentation" size="2" tabIndex={-1} type="text" value={selectedValue ? renderInputValue(selectedValue) : ''} variant="surface" onKeyDown={(event) => event.preventDefault()} onFocus={(event) => { // In the event that the input is focused programmatically, // redirect focus to the trigger event.preventDefault(); triggerRef.current?.focus(); }} > <TextField.Slot> <BracesIcon /> </TextField.Slot> <TextField.Slot> <Flex align="center" height="16px" justify="center" width="16px" > {selectedValue ? ( <ComboboxClear className={styles.clearButton} disabled={disabled} triggerId={triggerId} onClear={() => { flushSync(() => { handleSelectionChange(null); }); triggerRef.current?.focus(); }} /> ) : ( <ChevronDownIcon /> )} </Flex> </TextField.Slot> </TextField.Root>
size=2variant=surface
size 2 textfield in Custom Credentials Formdashboard
size=2variant=classic
size 2 textfield in Custom Credentials Formdashboard
size=2variant=classic
size 2 textfield in Feature Flags Dialogdashboard
size=2

Admin Portal

4 variants found

TextField in Autocomplete Dateadmin-portal

/p/:portalSessionId/audit-logs/autocomplete

variant=surface
TextField in Date Range Pickeradmin-portal

/p/:portalSessionId/audit-logs/audit-logs-table/audit-logs-export-csv-modal

variant=surface
size 3 textfield in Edit Google Cloud Storage Details Dialogadmin-portal

/p/:portalSessionId/log-streams/:logStreamId/completed/components/edit/details

size=3
size 3 textfield in Edit S3 Details Dialogadmin-portal

/p/:portalSessionId/log-streams/:logStreamId/completed/components/edit/details

size=3

Context

TextField.Root
PropTypeDefaultRequired
defaultValue
string | numberno
invalid
booleanno
size
Responsive<"1" | "2" | "3">no
statedeprecated
"disabled" | "normal" | "read-only" | "invalid"no
suppressPasswordManagers
booleanno
type
"number" | "search" | "time" | "text" | "hidden" | "tel" | "url" | "email" | "date" | "datetime-local" | "month" | "password" | "week"no
value
string | numberno
variant
"soft" | "classic" | "surface"no

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

TextField.Slot
PropTypeDefaultRequired
color
"ruby" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | ... 8 more ...no
gap
Responsive<Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9">>no
pl
Responsive<Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9">>no
pr
Responsive<Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9">>no
px
Responsive<Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9">>no
side
"left" | "right"no

stateType: "disabled" | "normal" | "read-only" | "invalid"

Usage

Used 348 times across 2 packages

Dashboard
291
Admin Portal
57

Variant Distribution

side

right
96%
left
4%

size

1
3%
2
20%
3
77%

disabled

true
100%

variant

surface
67%
classic
33%

Where it's used

160 files

packages/dashboard/src/components/log-streams/log-stream-destination-s3.tsx12
packages/dashboard/src/components/log-streams/log-stream-destination-azure-sentinel.tsx10
packages/dashboard/src/legacy-pages/[environmentId]/test-idp/[connectionId]/index.tsx8
packages/dashboard/src/components/directory-sync/directory-attribute-map/directory-attribute-map.tsx7
packages/dashboard/src/components/directory-sync/directories/directory-workday/directory-workday.tsx6
packages/dashboard/src/components/log-streams/log-stream-destination-google-cloud-storage.tsx6

/p/:portalSessionId/log-streams/:logStreamId/completed/components/edit/details

packages/admin-portal/src/app/p/[portalSessionId]/log-streams/[logStreamId]/completed/components/edit/details/edit-azure-sentinel-details-dialog.tsx9
packages/admin-portal/src/app/p/[portalSessionId]/log-streams/[logStreamId]/completed/components/edit/details/edit-google-cloud-storage-details-dialog.tsx7
packages/admin-portal/src/app/p/[portalSessionId]/log-streams/[logStreamId]/completed/components/edit/details/edit-s3-details-dialog.tsx7
packages/admin-portal/src/app/p/[portalSessionId]/log-streams/[logStreamId]/completed/components/edit/details/edit-generic-https-details-dialog.tsx6

Show 150 more files