Config
string
required
The component name. Used in error messages, the registry, and slot validation. Must be unique.
object
Schema defining the component’s accepted props. Each key is a prop name, each value is a prop descriptor.
function
required
Receives the resolved props (defaults applied, validated) and returns a vnode.
Prop descriptor
Each entry inprops accepts the following fields:
Prop types
Contract errors
If a prop contract is violated, Solar throws a structuredContractError before the component renders:
e.toJSON() to get the structured object, or e.message for the human-readable string.
Slots
Slots are typed component composition. A slot prop expects a vnode produced by a specific component:createElement vnode instead of a Button vnode throws a ContractError.
Return value
defineComponent returns a component function. Call it with props to get a vnode:
_source property set to the component name. The slot system uses it for type checking.