Overview
Svelte Atoms Core uses a unique Bond Architecture for state management. Bonds are self-contained state objects that communicate through Svelte’s context system, providing predictable and type-safe state management.Svelte 5 Runes
All components leverage Svelte 5’s new reactivity system with runes:State with $state
Create reactive state that automatically updates the UI:
Derived State with $derived
Compute values that automatically update when dependencies change:
Effects with $effect
Run side effects when state changes:
Understanding Bonds
Bonds are the core state management abstraction in Svelte Atoms Core. They encapsulate component state and provide a consistent interface for state access and manipulation.What is a Bond?
A Bond is a class that extends the baseBond class:
Bonds provide:
- State management - Reactive state with Svelte 5 runes
- Element references - Access to DOM elements
- Context-based communication - Share state between components
- Lifecycle management - Setup and cleanup
Accessing Component Bonds
Components expose their bond through snippets:Bond State Properties
Each bond has astate property that provides access to component state:
Component State Patterns
Controlled Components
Control component state from parent:Uncontrolled Components
Let components manage their own state:Custom State Management
Using filterDropdownData
ThefilterDropdownData utility creates reactive filtered state:
Custom Runes
Svelte Atoms Core provides custom runes for common patterns:State Management Best Practices
Advanced Bond Usage
Custom Bond Factories
Create custom bonds for specialized behavior:Next Steps
Using Components
Learn component composition patterns
Customization
Customize components with variants
TypeScript
Type-safe state management
API Reference
Full API documentation