class documentation

class ModalView(Button): (source)

Constructor: ModalView(**kwargs)

View In Hierarchy

Represents a button in a View that opens up an interactive modal.

Examples:

import fiftyone.operators.types as types

schema = {
    "modal": {"icon": "local_offer", "iconVariant": "outlined", "title": "Modal Title", "subtitle": "Modal Subtitle", "body": "Modal Body", textAlign: {title: "center", subtitle: "left", body: "right"}},
    "primaryButton": {"primaryText": "This is the primary button", "primaryColor": "primary", "params": {"foo": "bar", "multiple": True}},
    "secondaryButton": {"secondaryText": "This is the secondary button", "secondaryColor": "secondary"},
    "primaryCallback": self.do_something(),
    "secondaryCallback": self.do_nothing(),
    "functionality": "tagging",
}
modal = types.ModalView(**schema, label="This is a modal", variant="outlined", icon="local_offer")

.. note::
    The primary callback is called when the primary button is clicked and the secondary callback is called when the secondary button is clicked.
    Secondary callback defaults to a closure of the modal unless defined.
    Buttons of ModalView inherit all functionality of ButtonView.

inputs = types.Object()
inputs.view("modal_btn", modal)
Parameters
modalthe textual content of the modal
primaryButtonthe properties of the primary button
secondaryButtonthe properties of the secondary button
primaryCallbackthe function to execute when the primary button is clicked
secondaryCallbackthe function to execute when the secondary button is clicked
functionalitythe name of the functionality to execute when the primary button is clicked. Available options are 'tagging'
Method __init__ Undocumented

Inherited from Button:

Method to_json Undocumented
Instance Variable href Undocumented
Instance Variable operator Undocumented
Instance Variable params Undocumented
Instance Variable prompt Undocumented

Inherited from View (via Button):

Method clone Undocumented
Method kwargs_to_json Undocumented
Instance Variable component Undocumented
Instance Variable componentsProps Undocumented
Instance Variable container Undocumented
Instance Variable placeholder Undocumented
Instance Variable read_only Undocumented
Instance Variable space Undocumented
Instance Variable _kwargs Undocumented
def __init__(self, **kwargs): (source) ΒΆ