--- title: "Prompt Input" slug: prompt-input category: component type: technical-information version: 20.0.0 tokens: 1414 source: https://ovh.github.io/design-system/v20.0.0/llms/react-components-prompt-input--technical-information.txt --- # Prompt Input ## PromptInput This component extends all the native `
` attributes. | Property | Type | Required | Default | Description | |---|---|---|---|---| | `defaultValue` | `string` | No | undefined | The initial textarea value. Use when you don't need to control the value of the textarea. | | `disabled` | `boolean` | No | undefined | Whether the component is disabled. | | `fileCollection` | `File[]` | No | undefined | Array of the files associated with the prompt input. | | `i18n` | `Partial` | No | undefined | Internal translations override. | | `loading` | `boolean` | No | undefined | Whether the component is in loading state. | | `locale` | `'de' | 'en' | 'es' | 'fr' | 'it' | 'nl' | 'pl' | 'pt'` | No | undefined | The locale used for the translation of the internal elements. | | `name` | `string` | No | undefined | The name of the textarea form element. Useful for form submission. | | `onFileChange` | `(detail: PromptInputFileChangeDetails) => void` | No | undefined | Callback fired when a file change is triggered on the file-upload button. | | `onInputSubmit` | `(detail: PromptInputInputSubmitDetails) => void` | No | undefined | Callback fired when the prompt input is submitted. | | `onValueChange` | `(detail: PromptInputValueChangeDetails) => void` | No | undefined | Callback fired when the prompt input text value changes. | | `readOnly` | `boolean` | No | undefined | Whether the component is readonly. | | `value` | `string` | No | undefined | The controlled textarea value. | ## PromptInputControls This component extends all the native `
` attributes. _No specific property._ ## PromptInputFiles This component extends all the native `
` attributes. _No specific property._ ## PromptInputFileUploadButton | Property | Type | Required | Default | Description | |---|---|---|---|---| | `accept` | `string` | No | undefined | Expected file type in file upload controls | | `emphasis` | `BUTTON_EMPHASIS` | No | undefined | The emphasis preset to use, setting the visual weight of the button. | | `loading` | `boolean` | No | undefined | Whether the component is in loading state, disabling it. | | `multiple` | `boolean` | No | undefined | Whether multiple files can be selected at once | | `size` | `'xs' | 'sm' | 'md'` | No | undefined | The size preset to use. | | `status` | `BUTTON_STATUS` | No | undefined | The status preset to use. | ## PromptInputRoot | Property | Type | Required | Default | Description | |---|---|---|---|---| | `defaultValue` | `string` | No | undefined | The initial textarea value. Use when you don't need to control the value of the textarea. | | `disabled` | `boolean` | No | undefined | Whether the component is disabled. | | `fileCollection` | `File[]` | No | undefined | Array of the files associated with the prompt input. | | `i18n` | `Partial` | No | undefined | Internal translations override. | | `loading` | `boolean` | No | undefined | Whether the component is in loading state. | | `locale` | `'de' | 'en' | 'es' | 'fr' | 'it' | 'nl' | 'pl' | 'pt'` | No | undefined | The locale used for the translation of the internal elements. | | `name` | `string` | No | undefined | The name of the textarea form element. Useful for form submission. | | `onFileChange` | `(detail: PromptInputFileChangeDetails) => void` | No | undefined | Callback fired when a file change is triggered on the file-upload button. | | `onInputSubmit` | `(detail: PromptInputInputSubmitDetails) => void` | No | undefined | Callback fired when the prompt input is submitted. | | `onValueChange` | `(detail: PromptInputValueChangeDetails) => void` | No | undefined | Callback fired when the prompt input text value changes. | | `readOnly` | `boolean` | No | undefined | Whether the component is readonly. | | `value` | `string` | No | undefined | The controlled textarea value. | ## PromptInputSendButton | Property | Type | Required | Default | Description | |---|---|---|---|---| | `emphasis` | `BUTTON_EMPHASIS` | No | undefined | The emphasis preset to use, setting the visual weight of the button. | | `loading` | `boolean` | No | undefined | Whether the component is in loading state, disabling it. | | `size` | `'xs' | 'sm' | 'md'` | No | undefined | The size preset to use. | | `status` | `BUTTON_STATUS` | No | undefined | The status preset to use. | ## PromptInputTextControl | Property | Type | Required | Default | Description | |---|---|---|---|---| | `invalid` | `boolean` | No | undefined | Whether the component is in error state. | | `placeholder` | `string` | No | undefined | - | ## Enums ### PROMPT_INPUT_I18N - `fileUploadButton` = `promptInput.fileUpload.button` - `sendButton` = `promptInput.send.button` ## CSS Variables | Variable | Default value | |---|---| | `--ods-prompt-input-border-color` | `var(--ods-semantic-color-border-control)` | | `--ods-prompt-input-border-color-focus` | `var(--ods-semantic-color-interaction-control-hover)` | | `--ods-prompt-input-border-color-hover` | `var(--ods-semantic-color-interaction-control-hover)` | | `--ods-prompt-input-border-radius` | `var(--ods-semantic-size-radius-container)` | | `--ods-prompt-input-control-padding-vertical` | `calc(var(--ods-semantic-size-space-inset-block) / 2)` | | `--ods-prompt-input-control-padding-horizontal` | `var(--ods-semantic-size-space-inset-inline)` | | `--ods-prompt-input-control-border-color` | `transparent` | | `--ods-prompt-input-control-line-height` | `1.375em` | | `--ods-prompt-input-control-min-lines` | `1` | | `--ods-prompt-input-control-max-lines` | `5` | | `--ods-state-is-disabled-opacity` | `var(--ods-semantic-opacity-disabled)` |