Skip to contentSkip to Content
Feedback
ComponentsTypeBadge

TypeBadge

A small inline badge for displaying a type annotation. Renders as a styled badge with monospace font. When an href is provided, the badge becomes a link to the type’s documentation page. Every type in a generated parameter table is one.

API

TypeBadge

PropTypeDefaultDescription
typestring—The type annotation text (e.g. "str", "list[int]", "Optional[Config]").
hrefstring—Optional URL to link the badge to a type’s documentation page.

Example

Returns a Config object. The timeout parameter accepts float or None.

Returns a <TypeBadge type="Config" href="/docs/configuration" /> object. The timeout parameter accepts <TypeBadge type="float" /> or <TypeBadge type="None" />.