Introduction
component-shape lets Rust libraries describe a UI component once and expose
the public contracts that frameworks, code generators, and Model Context
Protocol (MCP) integrations need. Those contracts cover naming, value
compatibility, runtime capabilities, render behavior, and structured model input.
A shape is a Rust type that describes a component. Its metadata lets a consumer choose compatible values and input formats; framework-specific traits add construction, rendering, and event handling.
Choose the entry point that owns your task:
- Use
component-shapeto publish framework-neutral metadata or build a generator or framework adapter. - Use
component-shape-gpuito declare GPUI components, construction, rendering, and value binding. - Use
component-shape-mcpto turn coarse component metadata or typed Rust inputs into JSON Schema, MCP tools, composed servers, and stdio applications.
Start with Getting started to add a dependency. The remaining chapters explain how to combine the contracts without coupling the framework-neutral crate to GPUI or MCP protocol behavior.
For complete signatures and trait definitions, use the
component-shape API documentation,
component-shape-gpui API documentation,
and
component-shape-mcp API documentation.