Example
This is an interactive example of the Tries end.
- End
- View Form
Your Results!
Imports
This is a list of all exported components and functions. These are only relevant if you want to use this end in a standalone way.
import {
End, EndSchema,
ViewForm
} from "@bitflow/end-tries"
- End: The component displays the end.
- ViewForm: A form to set the neccessary data for a end.
- EndSchema: Is a zod schema, which can be used to validate an end object. It follows the JSON schema down below.
Usage
We recommand that you wrap this component with the EndShell component like so, if you want to use the component on its own.
import { EndShell } from "@bitflow/shell";
import { evaluate, End } from "@bitflow/end-tries";
const My = () => (
<EndShell
onNext={async () => {}}
EndComponent={End}
end={end}
/>
);
You can also use this end with the Do component.JSON Schema
If you do not want to use the provided forms to create an end 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": "tries"
},
"view": {
"type": "object",
"properties": {
"markdown": {
"type": "string"
}
},
"required": [
"markdown"
],
"additionalProperties": false
}
},
"required": [
"name",
"description",
"subtype",
"view"
],
"additionalProperties": false
}