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