using Astralis; using Invercargill; using Invercargill.DataStructures; using Inversion; using Spry; /** * FeaturesPage - Detailed features overview * * Showcases all the capabilities of the Spry framework */ public class FeaturesPage : PageComponent { public const string ROUTE = "/features"; public override string markup { get { return """
Everything you need to build modern, reactive web applications in Vala
Build your UI with reusable, composable components that encapsulate state and behavior.
Each component manages its own state, making your code predictable and testable.
Use outlets to compose components together, creating complex UIs from simple parts.
prepare() and handle_action() hooks give you control over component behavior.
Add dynamic behavior without writing JavaScript. Spry makes HTMX even more powerful.
<!-- Declarative actions -->
<button spry-action=":Toggle"
spry-target="item"
hx-swap="outerHTML">
Toggle Item
</button>
<!-- Cross-component communication -->
<form spry-action="ListComponent:Add"
hx-target="#my-list">
<input name="title" />
<button type="submit">Add</button>
</form>
<!-- Out-of-band updates -->
<div spry-global="header">
Updates automatically when data changes
</div>
Declare component actions directly in your markup. No event listeners needed.
Target elements within your component using simple sid references.
Update multiple page regions with out-of-band HTMX swaps.
Powered by Inversion, get clean, testable code with automatic dependency resolution.
class TodoComponent : Component {
// Inject dependencies in field initializers
private TodoStore store = inject<TodoStore>();
private ComponentFactory factory = inject<ComponentFactory>();
private HttpContext http = inject<HttpContext>();
}
// Register services with different lifecycles
application.add_singleton<AppState>(); // One instance forever
application.add_scoped<ComponentFactory>(); // One per request
application.add_transient<MyComponent>(); // New each time
Create reusable layouts with nested templates that automatically wrap your pages.
Stack templates to create complex layouts from simple, reusable pieces.
Templates are applied based on route prefixes, automatically wrapping matching pages.
Use
Built on Astralis for native code performance with web framework convenience.