Skip to content

ClassMethod

Renders a <details> element with an anchor link, modifier badges, and a slot for parameters, return types, and description.

PropTypeDefaultDescription
namestringrequiredMethod name (also used as the element id)
highlightstring"function"Syntax highlight type for the name
openbooleanfalsePre-expand this method card
SlotDescription
modifiersClassModifier badges rendered in the summary bar. The first badge determines the sash (colored left border). Without modifiers, the sash defaults to the highlight color (e.g. function color).
(default)ClassMethodInput, ClassMethodOutput, and free-form text/markdown.
<CB.ClassMethod name="findById" highlight="function">
<CB.ClassModifier slot="modifiers" type="public" />
Looks up a user by their unique identifier.
<CB.ClassMethodInput name="id" type="string">The user ID</CB.ClassMethodInput>
<CB.ClassMethodOutput type="User | null">The user, or null if not found</CB.ClassMethodOutput>
</CB.ClassMethod>