Skip to content

TypeReference

A type reference like Foo[T, P] or int.

import { TypeReference } from "@alloy-js/python";
<TypeReference name={Children} refkey={Refkey} typeArgs={Children[]} />
nameoptionalChildrenA raw name to reference when no refkey is provided.
refkeyoptionalRefkeyA refkey to a declared symbol.
typeArgsoptionalChildren[]Type arguments to render inside brackets.

This component automatically wraps its content in a type reference context, so any symbols referenced via refkey will be imported as type-only (inside a if TYPE_CHECKING: block) unless also used as values elsewhere.