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