Example
This is an interactive example of the Simple start.
- Start
- View Form
Welcome
This is an example. Feel free to use it as a template.
Imports
This is a list of all exported components and functions. These are only relevant if you want to use this start in a standalone way.
import {
Start, StartSchema,
ViewForm
} from "@bitflow/start-simple"
- Start: The component displays the start.
- ViewForm: A form to set the neccessary data for a start.
- StartSchema: Is a zod schema, which can be used to validate an start object. It follows the JSON schema down below.
Usage
We recommand that you wrap this component with the StartShell component like so, if you want to use the component on its own.
import { StartShell } from "@bitflow/shell";
import { evaluate, Start } from "@bitflow/start-simple";
const My = () => (
<StartShell
onNext={async () => {}}
StartComponent={Start}
start={input}
/>
);
You can also use this start with the Do component.JSON Schema
If you do not want to use the provided forms to create an start object, you can build something yourself which produces a object, which follows this JSON schema.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"subtype": {
"type": "string",
"const": "simple"
},
"view": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"markdown": {
"type": "string"
}
},
"required": [
"title",
"markdown"
],
"additionalProperties": false
}
},
"required": [
"name",
"description",
"subtype",
"view"
],
"additionalProperties": false
}