BloomIsland class

Emits a server-rendered island placeholder element configured with the given hydration strategy and props.

Wraps child (or children) inside an element tagged with bloomIslandAttribute matching name. During server-side rendering (renderToHtml), the static HTML markup of child is emitted into the stream alongside serialized props and strategy metadata. In the browser, BloomIslandOrchestrator discovers the placeholder and hydrates the interactive subtree in place.

Example

Server-Side SSR Rendering:

BloomIsland(
  name: 'counter',
  strategy: HydrationStrategy.visible,
  props: {'initialCount': 5},
  child: Div(
    className: 'counter-box',
    children: [
      const Span(text: 'Count: 5'),
      Button(text: '+1'),
    ],
  ),
)

Client-Side Registration & Hydration:

registerIsland('counter', (props) {
  final count = signal(props['initialCount'] as int? ?? 0);
  return Div(
    className: 'counter-box',
    children: [
      Live(() => Span(text: 'Count: ${count.value}')),
      Button(text: '+1', on: {'click': (_) => count.value++}),
    ],
  );
});

void main() {
  orchestrateIslands();
}
Inheritance

Constructors

BloomIsland({required String name, BloomNode? child, List<BloomNode>? children, HydrationStrategy strategy = HydrationStrategy.immediate, Map<String, dynamic>? props, String? rootMargin, String? media, String tag = 'div', String? className, String? style, Map<String, String>? attrs})
Creates a server-side island placeholder descriptor.

Properties

attrs Map<String, String>?
Arbitrary HTML attributes (id, href, placeholder, etc.).
finalinherited
children List<BloomNode>
Child descriptors nested within this element.
finalinherited
className String?
CSS class attribute applied to the element.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
on Map<String, BloomEventHandler>?
Event handlers keyed by DOM event name (click, input, change...).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style String?
Inline style — raw CSS string (e.g. "color: red; display: flex;").
finalinherited
tag String
Lowercase tag name, e.g. "div", "button", "custom-tag".
finalinherited
text String?
Optional single text child sugar — equivalent to children: [Text(text)] when no explicit children are given.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited