Skip to main content

Types

This page summarizes the primary public types exported by @weaverse/hydrogen and @weaverse/schema.

Component Types

HydrogenComponent

A component definition registered with Weaverse. The default export can be a forwarded-ref component or a function component.

HydrogenComponentProps

HydrogenComponentSchema

HydrogenComponentSchema is the current public alias for SchemaType. The type itself is not deprecated; only inspector and enabledOn are deprecated.
label is optional and available in @weaverse/schema 0.17.0+ / @weaverse/hydrogen 5.22.0+. The method signature accepts callbacks explicitly annotated with the component’s props type, such as label: (data: HeadingProps) => data.content; without an annotation, data is Record<string, any>. It returns synchronous plain text for the Studio outline, not a replacement for the static title. See label for the example, preview-language behavior and fallback rules. Use createSchema() to type-check an object against SchemaType and enable development-time diagnostics:
createSchema() returns the original schema immediately. Outside production it asynchronously lazy-loads Zod and logs validation issues as warnings; validation and import failures do not throw through the call. Production builds skip this validation path.

HydrogenComponentData

Inspector Types

The public types retain “Inspector” in their names for compatibility, but new schemas should use the settings property.

InspectorGroup

BasicInput

String conditions remain supported but are deprecated; prefer a function.

HeadingInput

Loader Types

ComponentLoaderArgs

RouteLoaderArgs

WeaverseRouteAppLoadContext includes the Hydrogen context and a weaverse: WeaverseClient property.

WeaverseLoaderData

Theme Types

HydrogenThemeSettings

HydrogenThemeSchema

media sets what the Media Manager gallery hides for every picker in the theme. It is a sibling of settings rather than an entry inside it, because settings renders as merchant-editable controls and these rules are meant to be fixed by the theme author. An image or video input can override them for its own picker — see Filtering the Media Manager gallery. routes declares URL patterns that Studio uses for page navigation and URL picking. It is available as a typed field in @weaverse/hydrogen 5.23.0+ and on WeaverseNextThemeSchema in stable @weaverse/next 1.0.0+. See Declare Theme Routes for Studio for configuration, the Forward example, and fallback behavior.

ThemeRoutes and ThemeRoutePageType

Exported by @weaverse/schema 0.18.0+ and re-exported by @weaverse/hydrogen and @weaverse/next:
Each optional entry maps a supported page type to an absolute path with static segments and whole :handle or :blog segments. CUSTOM pages carry their own path; * is not a route key. TypeScript checks the keys, while pattern values remain strings. See the guide’s supported keys and patterns for the grammar and parameter meanings.

Page Types

Component Availability

The canonical types are exported by @weaverse/schema and re-exported by @weaverse/hydrogen:
Use enabled for static or synchronous conditional availability:
enabledOn remains supported for backward compatibility but is deprecated. Avoid relying on undocumented behavior for thrown errors, promises, RPC serialization, or existing instances; these semantics are not part of the public SDK contract. enabled controls insertion availability only. A type listed in any component’s childTypes appears in the root Add Section picker only when its enabledOn.groups contains 'body' or '*', even if enabled returns true. Keep that field on dual-use components during migration; see Standalone and Nested Components.

Internationalization

Usage Example

Type Extensions

A Hydrogen app can augment its load context and environment:
Last modified on October 20, 2026