Tally UI

CartNoteInput

CartNoteInput expands from an Add customer note link into a multiline customer note field, with controlled text, a customizable label and placeholder.

Import

import { CartNoteInput } from '@tallyui/components';

Usage

const [note, setNote] = useState('');
<CartNoteInput value={note} onChangeText={setNote} />

Starts as a compact "Add customer note" link. Tapping it expands into a multiline text input. If the value already has content, the input starts expanded. WooCommerce sends the note as customer_note, so it shows on the customer's emails and receipts.

Props

PropTypeDefaultDescription
valuestringrequiredCurrent note text
onChangeText(text: string) => voidrequiredCallback when text changes
labelstring'Customer note'The note's name: the link reads "Add" plus the label in lower case, and the input uses it as its placeholder and accessibility label
placeholderstringthe labelPlaceholder text for the input
classNamestring—Override container styles

Live demo