Play Strawberry Docs
Referencia

Esta página se muestra en inglés.

forms

Bedrock simple, modal, and custom form definitions.

Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.

How to use it: guide.

WIT declarations

text
use text.{text-component};

enum image-type {
    url,
    path,
}

record form-image {
    %type: image-type,
    data: string,
}

record simple-form-button {
    text: text-component,
    image: option<form-image>,
}

record simple-form {
    title: text-component,
    content: text-component,
    buttons: list<simple-form-button>,
}

record modal-form {
    title: text-component,
    content: text-component,
    button1: text-component,
    button2: text-component,
}

variant custom-form-element {
    label(text-component),
    toggle(tuple<text-component, bool>),
    slider(tuple<text-component, f32, f32, f32, f32>),
    step-slider(tuple<text-component, list<string>, u32>),
    dropdown(tuple<text-component, list<string>, u32>),
    input(tuple<text-component, string, string>),
}

record custom-form {
    title: text-component,
    elements: list<custom-form-element>,
}

variant form {
    simple(simple-form),
    modal(modal-form),
    custom(custom-form),
}

En esta página