,
shortcut: "t",
composer: {
title: "New task",
placeholder: "What needs doing?",
choices: { label: "Due", options: ["Today", "Tomorrow", "Next week"] },
submitLabel: "Add",
successLabel: "Task added",
},
},
{
id: "note",
label: "New note",
icon:
,
shortcut: "n",
composer: { title: "New note", placeholder: "Write a note", multiline: true, submitLabel: "Save", successLabel: "Note saved" },
},
]}
onSubmit={({ action, text, choice }) => save(action, text, choice)}
/>
);
}
```
### API reference
#### ActionMorph
A floating action button that springs into a quick action menu, slides into an inline composer, and folds back with a check on success.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `actions` (required) | `ActionMorphAction[]` | – | Actions: { id, label, description?, icon, shortcut?, composer }. composer is { title, placeholder, multiline?, choices?, submitLabel, successLabel, emptyHint? }. |
| `label` | `string` | `"Create"` | Accessible name of the button and the title of the menu. |
| `onSubmit` | `(submission: ActionMorphSubmission) => void \| Promise