Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Activity Composer

ProNew

One box for a note, a call, an email or a task. Tabs choose the kind, the field each kind needs opens without a jump, and the button shows progress, confirms and clears.

Installation

pnpm dlx shadcn@latest add @viewport/activity-composer

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
onSubmit*(activity: Activity) => void | Promise<void>

Called with the activity when it is logged. Return a promise to show progress until it settles.

—
subjectstring

Who or what the activity is about, used in the placeholder, e.g. "Mara".

"this record"
outcomesstring[]

The ways a call can end.

["Connected", "Left a voicemail", "No answer"]
kindsActivityKind[]

Which kinds to offer, in order.

["note", "call", "email", "task"]
classNamestring—

Accessibility

  • Tabs with arrow-key movement and one Tab stop.
  • Every field has a label; the text box is labelled by the kind.
  • Ctrl or Command with Enter submits.
  • The confirmation is announced.
  • The extra field appears without the height transition under reduced motion.