Skip to content

ClassModifier

Renders a modifier badge (e.g. public, private, static, nomask). Works in any context — inside ClassBrowser, ClassMethod, or ClassProperty.

When used inside ClassMethod, place it in the modifiers named slot so it renders in the summary bar. The first modifier badge determines the colored left border (sash). Methods without any modifiers default to the highlight color (typically the function color).

PropTypeRequiredDescription
typestringYesThe modifier name (becomes both the label and the CSS class)

public, private, protected, nomask, nosave, static, varargs

Any other value falls back to the default badge style. You can add custom colors via CSS:

.cb-badge-readonly { color: #fff; background: #0891b2; }
<CB.ClassMethod name="doSomething">
<CB.ClassModifier slot="modifiers" type="public" />
<CB.ClassModifier slot="modifiers" type="nomask" />
...
</CB.ClassMethod>
<CB.ClassBrowser name="BaseWidget" type="class">
<CB.ClassModifier type="abstract" />
...
</CB.ClassBrowser>