Skip to main content

focus

On mount, focuses and selects the first enabled control in the form that accepts text input. Set it when the editor opens in a panel or modal and the user should start typing right away.

Usage

focus?: boolean;

Default: false.

Example

import { Editor, Willow } from "@svar-ui/react-editor";

const items = [{ comp: "text", key: "name", label: "Name" }];
const values = { name: "John Doe" };

export default function App() {
return (
<Willow>
<Editor items={items} values={values} focus placement="modal" />
</Willow>
);
}