Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

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-shape to publish framework-neutral metadata or build a generator or framework adapter.
  • Use component-shape-gpui to declare GPUI components, construction, rendering, and value binding.
  • Use component-shape-mcp to 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.