API Reference
Detailed API documentation for Melt UI components and utilities.
Component APIs
Each Melt UI component exposes a consistent API pattern through both its builder and component implementations.
Common Patterns
Most components follow these common patterns:
- Builder Creation: Instantiate with optional configuration
- Root Element: Access via
.root
for base attributes - Value Management: Get/set via
.value
property - Event Handlers: Prefixed with
on
, likeonValueChange
- State Queries: Methods prefixed with
is
, likeisSelected
- Actions: Methods for state manipulation, like
select
,deselect
Type Definitions
Components expose TypeScript types for props and events:
Utility Types
MaybeGetter
Represents a value that can be either the type itself or a function that returns the type:
ComponentProps
Utility type for component props that handles proper typing of event handlers and other component-specific properties:
Builder Methods
Common methods available on builders:
State Management
DOM Attributes
Event Handlers
Component Usage
Components wrap builders to provide a more traditional Svelte component experience: