Tally UI

OrderNoteSheet

OrderNoteSheet edits a controlled note live in WCPOS v2's Order details sheet, with a customizable field label.

Import

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

Usage

import { useState } from 'react';

function NoteEditor() {
  const [note, setNote] = useState('');
  const [open, setOpen] = useState(true);

  return open ? (
    <OrderNoteSheet
      value={note}
      onChangeText={setNote}
      onOpenChange={setOpen}
    />
  ) : null;
}

This is WCPOS v2's Order details sheet, opening on the left so the cart's note row stays in view. It writes on every keystroke, and Close calls onOpenChange(false); Cart opens it for you when given noteSheet.

Props

PropTypeDefaultDescription
valuestringrequiredCurrent note text
onChangeText(text: string) => voidrequiredCalled on every edit with the untrimmed text
onOpenChange(open: boolean) => voidrequiredCalled when the dialog requests an open state change; Close calls it with false
labelstring'Customer note'The field's label and accessible name; the placeholder is "Add" plus the label in lower case

On this page