Nasaq

Activity Composer

Log a note, call, meeting or task, then read the history with open tasks first. Tasks tick off in place.

PreviewOpen ↗

Code

<ActivityComposer onSubmit={async ({ kind, body, at, durationMinutes }) => save(...)} /><ActivityTimeline activities={items} onToggleTask={toggle} onDelete={remove} />

CRM · beta

Live examples and controls: Activity Composer in the lab.

Install

npx shadcn@latest add https://docs.nasaqui.com/r/activity-composer.json

The place to write down what happened with a contact, a deal or an issue, and to see what is still to do.

When to use

  • Logging calls, meetings and notes on a record.
  • Follow-up tasks with a due time that sit above the history until done.

When not to use

  • System events only: use Timeline.
  • A long checklist inside one task: use Checklist.

Import

import { ActivityComposer, ActivityTimeline } from "@fadymondy/nasaq/web";

Quick start

<ActivityComposer onSubmit={async ({ kind, body, at, durationMinutes }) => save(...)} />
<ActivityTimeline activities={items} onToggleTask={toggle} onDelete={remove} />

Anatomy

ActivityComposer       data-slot="activity-composer"
├─ kind tabs           note, call, meeting, task
├─ body                text
├─ when                date and time (due for a task)
├─ duration            calls and meetings
└─ submit
ActivityTimeline       data-slot="activity-timeline"
├─ open tasks          soonest due first, overdue flagged
└─ history             newest first

API

PropTypeDefaultDescription
onSubmit(input) => Promise<...>required{ kind, body, at, durationMinutes? }. Return { error } to keep the text.
kindsComposableKind[]all fourWhich kinds can be logged.
defaultKindComposableKindnoteThe kind shown first.
activitiesActivityRecord[]required (timeline){ id, kind, body, at, actor?, durationMinutes?, done? }.
onToggleTask(id, done) => Promise<...>noneOmit for read-only tasks.
onDelete(id) => Promise<...>noneOmit to hide delete.
nownumberDate.now()For overdue.
loading / emptyboolean / ReactNodenoneSkeleton and custom empty state.
labelsActivityLabelsen / arEvery string.

Examples

  • Task only: kinds={["task"]}.

Accessibility

The kind switch is a tab list; fields are labelled; validation errors use role="alert". Row actions open from a button menu or a context-click.

RTL & i18n

English and Arabic built in. Dates and durations use the locale; the datetime field stays left-to-right.

Styling & tokens

Semantic tokens only.

Do / Don't

  • Do let a failed save keep the typed text.
  • Do not use it as a general chat.

Lab

https://docs.nasaqui.com/?path=/docs/components-crm-activity-composer--docs

On this page