mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
* feat: add free-antd-materials * feat: add demo-nextjs-antd * fix(free-antd-materials): pass ts tests * chore: rename free-antd-materials to form-antd-materials
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { Field } from '@flowgram.ai/free-layout-editor';
|
|
|
|
export const FormRender = () => (
|
|
<>
|
|
<div className="w-full cursor-move">
|
|
<Field<string> name="title">
|
|
{({ field }) => <h1 className="text-xl font-bold">{field.value}</h1>}
|
|
</Field>
|
|
</div>
|
|
<div className="content flex flex-col gap-3">
|
|
<Field<string> name="input">
|
|
{({ field }) => (
|
|
<div className="inline-flex justify-between w-full">
|
|
<h2 className="text-lg">Input</h2>
|
|
<input
|
|
className="border border-gray-400 rounded"
|
|
value={field.value}
|
|
onChange={field.onChange}
|
|
/>
|
|
</div>
|
|
)}
|
|
</Field>
|
|
<Field<string> name="output">
|
|
{({ field }) => (
|
|
<div className="inline-flex justify-between w-full">
|
|
<h2 className="text-lg">Output</h2>
|
|
<input
|
|
className="border border-gray-400 rounded"
|
|
value={field.value}
|
|
onChange={field.onChange}
|
|
/>
|
|
</div>
|
|
)}
|
|
</Field>
|
|
</div>
|
|
</>
|
|
);
|