code

class trame.widgets.code.Editor(completion=None, hover=None, **kwargs)

Bases: AbstractElement

Monaco Editor component

Properties:

Parameters:
  • options

  • value

  • model_value

  • theme

  • language

  • textmate

  • completion – a callable fn(code, line, column) returning a list of completion items, each a dict with keys label (required), kind, detail, documentation, insertText. line is 1-based, column 0-based. Registered as a trigger internally so the client can invoke it and receive the returned items (Monaco needs the result back).

  • hover – a callable fn(code, line, column) returning hover content: a markdown string, a list of markdown strings, {contents: [...]}, or None. Registered as a trigger internally like completion.

  • completion_trigger_characters – list of characters that open the completion list (defaults to ["."] in the component).

Events:

Parameters:

input