Skip to contentSkip to Content
Feedback
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. Generated API pages do not write this component, since they give each method a heading of its own; use it by hand in the pages you write.

API

MethodAccordion

PropTypeDefaultDescription
methodsMethod[]—Array of method objects.

Method object

FieldTypeDefaultDescription
namestring—Method name.
signaturestring—Parameter signature (e.g. (self, x: int) -> bool).
descriptionstring—Description of what the method does.
isAsyncbooleanfalseIf true, displays an “async” badge next to the name.
childrenReactNode—Additional 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 } ]} />