(Optional) Generate a component using AI
As an alternative to manually creating a custom component, you can have Uiflow's AI automatically generate one for you. Upon providing a detailed description of your desired component features to Uiflow's AI in the CLI tool, your description will be used to generate a component with the corresponding properties and Actions.
To generate a new custom component with the AI tool:
- 1.Open a command line window.
- 2.Navigate to your
components
directory:cd <path-to-custom-components-directory>/components - 3.Run
npx uiflow add
to start the Uiflow CLI tool. - 4.Enter a name for the new component.
- 5.Select the type of component (UI or Logic) to generate and press enter / return.
- 6.Select Yes when prompted to let the AI generate the component for you.
- 7.Enter a description of the component you want Uiflow to generate.Note: You can be as detailed as you like.
- 8.Enter your Uiflow credentials when prompted.
- 9.Verify the details, select Yes, and press enter / return to continue.
- 10.Wait for Uiflow to generate the component. The process generally takes a minute to two.The location of the generated component's
index.tsx
file is displayed when the process completes. - 11.