Weiter zum Inhalt
Konto erstellen
oder
anmelden
Das Logo der Stripe-Dokumentation
/
KI fragen
Konto erstellen
Anmelden
Jetzt starten
Zahlungen
Umsatz
Plattformen und Marktplätze
Geldmanagement
Entwickler-Tools
Übersicht
Versionierung
Änderungsprotokoll
Aktualisieren Sie Ihre API-Version
Ihre SDK-Version aktualisieren
Entwickler-Tools
SDKs
API
Tests
Workbench
Ereignisziele
Arbeitsabläufe
Stripe-CLI
Stripe Shell
Entwickler-Dashboard
Agent-Toolkit
Mit LLMs entwickelnStripe für Visual Studio CodeStripe-StatuswarnungenHochgeladene Dateien
Sicherheit und Datenschutz
Sicherheit
Datenschutz
Extend Stripe
Stripe-Apps
    Übersicht
    Jetzt starten
    Eine App erstellen
    Funktionsweise von Stripe-Apps
    Beispiel-Apps
    App erstellen
    Shop-Geheimnisse
    API-Authentifizierungsmethoden
    Autorisierungsabläufe
    Serverseitige Logik
    Ereignisse überwachen
    Umgang mit verschiedenen Modi
    Sandbox-Unterstützung aktivieren
    App-Einstellungsseite
    Erstellen Sie eine Nutzeroberfläche
    Onboarding
    Ihre App verbreiten
    Vertriebsmöglichkeiten
    App hochladen
    Versionen und Releases
    Ihre App testen
    Ihre App veröffentlichen
    Ihre App bewerben
    Deep-Links hinzufügen
    Installationslinks erstellen
    Rollen in Erweiterungen der Nutzeroberfläche zuweisen
    Aktionen nach der Installation
    App-Analytik
    Eingebettete Komponenten für Apps
    Stripe-Apps von Drittanbietern einbetten
    Umstellung auf Stripe Apps
    Migrieren oder Erweiterung erstellen
    Ein Plugin zu Stripe Apps oder Stripe Connect migrieren
    Verwendungszweck
    App-Manifest
    CLI
    Erweiterungs-SDK
    Berechtigungen
    Darstellungsfelder
    Entwurfsmuster
    Komponenten
      Accordion
      Badge
      Banner
      Balkendiagramm
      Textfeld
      Schaltfläche
      ButtonGroup
      Kontrollkästchen
      Chip
      ContextView
      DateField
      Trennzeichen
      FocusView
      FormFieldGroup
      Symbol
      Img
      Inline
      Liniendiagramm
      Link
      Liste
      Menü
      PropertyList
      Radio
      Auswählen
      SettingsView
      SignInView
      Sparkline
      Sanduhr
      Wechseln
      Tisch
      Registerkarten
      Aufgabenliste
      TextArea
      TextField
      Toast
      QuickInfo
Stripe Connectors
Partner
Partner-Ecosystem
Partner-Zertifizierung
StartseiteEntwickler-ToolsStripe AppsComponents

Notiz

Bis jetzt ist diese Seite noch nicht in dieser Sprache verfügbar. Wir arbeiten aber verstärkt daran, unsere Dokumentation in weiteren Sprachen bereitzustellen, und werden die Übersetzung sofort anzeigen, sobald diese verfügbar ist.

TextArea component for Stripe Apps

Use TextArea to create an input field for multiple lines of text.

Seite kopieren

To add the TextArea component to your app:

import {TextArea} from '@stripe/ui-extension-sdk/ui';
Beispiel wird geladen ...
<TextArea label="Description" placeholder="Acme Inc was founded in…" defaultValue="Stripe Apps lets you embed custom…" onChange={(e) => { console.log(e.target.value); }} />

TextArea props

PropertyType

autoComplete

Optional

string | undefined

Specifies one of the possible autocomplete behaviors.

autoFocus

Optional

boolean | undefined

If true, React will focus the element on mount.

cols

Optional

number | undefined

css

Optional

CSS | undefined

Related types: CSS.

defaultValue

Optional

string | undefined

Specifies the initial value that a user can change.

description

Optional

string | undefined

Descriptive text that will be rendered adjacent to the control’s label.

disabled

Optional

boolean | undefined

Sets whether or not the element should be disabled. Prevents selection.

error

Optional

string | undefined

Error text that will be rendered below the control.

form

Optional

string | undefined

Specifies the id of the <form> this input belongs to. If omitted, it’s the closest parent form.

hiddenElements

Optional

("label" | "description" | "error")[] | undefined

Visually hides the specified elements. The hidden elements will still be present and visible to screen readers.

invalid

Optional

boolean | undefined

Sets whether or not the element is in an invalid state. This is a display-only prop, and will not prevent form submission.

label

Optional

React.ReactNode

Text that describes the control. Will be both visible and clickable.

maxLength

Optional

number | undefined

Specifies the maximum length of text.

minLength

Optional

number | undefined

Specifies the minimum length of text.

name

Optional

string | undefined

Specifies the name for this input that’s submitted with the form.

onChange

Optional

((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined

Required for controlled inputs. Fires immediately when the input’s value is changed by the user (for example, it fires on every keystroke). Behaves like the browser input event.

onKeyDown

Optional

((event: React.KeyboardEvent<HTMLInputElement>) => void) | undefined

Fires when a key is pressed.

onKeyUp

Optional

((event: React.KeyboardEvent<HTMLInputElement>) => void) | undefined

Fires when a key is released.

placeholder

Optional

string | undefined

Displayed in a dimmed color when the input value is empty.

readOnly

Optional

boolean | undefined

If true, the input is not editable by the user.

required

Optional

boolean | undefined

If true, the value must be provided for the form to submit.

resizeable

Optional

boolean | undefined

rows

Optional

number | undefined

size

Optional

("small" | "medium" | "large") | undefined

The size of the component.

spellCheck

Optional

boolean | "true" | "false" | undefined

If explicitly set to true or false, enables or disables spellchecking.

tabIndex

Optional

number | undefined

Overrides the default tab key behavior. Avoid using values other than -1 and 0.

value

Optional

string | undefined

Controls the input’s text. When you pass this prop, you must also pass an onChange handler that updates the passed value.

wrap

Optional

string | undefined

onKeyPress

OptionalDeprecated

((event: React.KeyboardEvent<HTMLInputElement>) => void) | undefined

CSS

PropertyType

width

Optional

(number | "auto" | "fill" | "min" | "max" | "fit" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12") | undefined

The width of the component. See Sizing for details.

Invalid

You can mark a TextArea as invalid by setting the invalid prop on the element. This is purely visual. It defaults to false.

Beispiel wird geladen ...
<TextArea label="Favorite word" defaultValue="Stripe Apps lets you embed custom…" invalid />

Resizeable

By default, TextArea is vertically resizable. Users who need more space typically prefer this. If you need to prevent the element from resizing, set resizeable to false.

Beispiel wird geladen ...
<TextArea label="Resizable bio" defaultValue="Stripe Apps lets you embed custom…" /> <TextArea label="Unresizable bio" resizeable={false} defaultValue="Stripe Apps lets you embed custom…" />

Size

Changing the size allows you to choose variants with slightly more or slightly less room than the default. In general you don’t want to mix and match different sizes within the same form. The default is medium.

Beispiel wird geladen ...
<TextArea label="Description (large)" size="large" defaultValue="Stripe Apps lets you embed custom…" /> <TextArea label="Description (medium, default)" size="medium" defaultValue="Stripe Apps lets you embed custom…" /> <TextArea label="Description (small)" size="small" defaultValue="Stripe Apps lets you embed custom…" />

Disable and read only

You can mark a field as disabled, which prevents any interaction and changes the styling. Disabled means that no data from that form element is submitted when the form is submitted.

You can also make a field as readOnly. Read-only means any data from within the element is submitted, but the user can’t change it.

Beispiel wird geladen ...
<TextArea label="Disabled" defaultValue="Stripe Apps lets you embed custom…" disabled /> <TextArea label="Readonly" defaultValue="Stripe Apps lets you embed custom…" readOnly />

Rows

A TextArea uses rows to control its height rather than using a traditional height in pixels, just like a regular <TextArea />. This allows the element to size itself based on multiples of the font size, rather than a raw pixel value. It prevents text from being partially obscured by default.

The vertical height of your TextArea component also changes depending on what size value you set, because that changes the line height of the text inside the input.

Beispiel wird geladen ...
<TextArea label="Description (3 rows, default)" defaultValue="Stripe Apps lets you embed custom…" /> <TextArea label="Description (6 rows)" rows={6} defaultValue="Stripe Apps lets you embed custom…" />

State management

Use the TextArea component as an uncontrolled input:

Beispiel wird geladen ...
<TextArea onChange={(e) => { console.log(e); }} label="About your business" placeholder="Our business is…" />

Width

Set the width of a TexaArea component using the available values with the css prop:

Beispiel wird geladen ...
<TextArea label="App feedback" defaultValue="Stripe Apps lets you embed custom…" css={{width: 'fill'}} />

Siehe auch

  • Design patterns to follow
  • Style your app
  • UI testing
War diese Seite hilfreich?
JaNein
Benötigen Sie Hilfe? Kontaktieren Sie den Kundensupport.
Nehmen Sie an unserem Programm für frühzeitigen Zugriff teil.
Schauen Sie sich unser Änderungsprotokoll an.
Fragen? Sales-Team kontaktieren.
LLM? Lesen Sie llms.txt.
Unterstützt von Markdoc