Configuration
Most apps need no configuration: usemorph sync reads what it needs from your code. For the extras code can't express, add an optional morph.config.ts next to your package.json:
import { defineConfig } from "@usemorph/cli";
export default defineConfig({
app: { name: "Ledgerly", description: "an invoicing app for small service businesses" },
styleGuide: "Use the classes btn, btn-primary, panel and muted. Colors are CSS variables like --accent.",
chat: {
greeting: "Hi! How should your dashboard work?",
suggestions: ["Put overdue invoices first", "Dark mode"],
},
});
| Option | |
|---|---|
app |
{ name, description }. Defaults to your package.json. The AI uses it for context. |
styleGuide |
Notes on your styling for the AI. Usually not needed: Morph sees your page's classes and theme when a user asks. |
chat |
{ greeting, suggestions } shown in the Morph box. |
foldPx |
Height in pixels counted as "without scrolling" for keep={{ aboveFold: true }}. Default 700. |
dataNotes |
Notes about your data the types don't say, like units and date formats. |
defaultCss |
Extra CSS for the starting layout. |
rules |
Rules beyond keep, e.g. { component: "nav", mustShow: true, topmost: true }. |
savedValues |
false stops pages from keeping values users type in (useSaved) in Morph's database; they last for the visit only. Default true. |
components |
Components the AI may place and configure with props. Describe each one here and pass them to <MorphSurface components={{ … }}>. |
surfaces |
Any of the above for one surface: surfaces: { dashboard: { chat: { … } } }. |
.js and .mjs files work too.