Skip to contentSkip to Content
ComponentsMethodAccordion

MethodAccordion

Expandable accordion panels for documenting class methods. Each method shows its name and signature in the header, with the full description revealed on click. Async methods display an “async” badge. This component is typically auto-generated for classes with public methods.

API

MethodAccordion

PropTypeDefaultDescription
methodsMethod[]Array of method objects.

Method object

FieldTypeDefaultDescription
namestringMethod name.
signaturestringParameter signature (e.g. (self, x: int) -> bool).
descriptionstringDescription of what the method does.
isAsyncbooleanfalseIf true, displays an “async” badge next to the name.
childrenReactNodeAdditional content (parameter tables, examples, etc.) rendered inside the accordion.

Example

<MethodAccordion methods={[ { name: "connect", signature: "(self, address: str, timeout: float = 30.0) -> None", description: "Establish a connection to a remote node.", isAsync: true }, { name: "disconnect", signature: "(self) -> None", description: "Close the current connection and release resources." }, { name: "send", signature: "(self, data: bytes, compress: bool = True) -> int", description: "Send data to the connected node. Returns bytes sent.", isAsync: true } ]} />