Activity Composer
ProNewOne 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
| Prop | Type | Default |
|---|---|---|
| onSubmit* | (activity: Activity) => void | Promise<void>Called with the activity when it is logged. Return a promise to show progress until it settles. | — |
| subject | stringWho or what the activity is about, used in the placeholder, e.g. "Mara". | "this record" |
| outcomes | string[]The ways a call can end. | ["Connected", "Left a voicemail", "No answer"] |
| kinds | ActivityKind[]Which kinds to offer, in order. | ["note", "call", "email", "task"] |
| className | string | — |
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.