Native Web Components playground

Nova v3.37.0

Preview

Web Components

Two-way binding

The application owns the selected value. Edit the field, then use Set Berlin to update it from application code.

Controlled

Assign the element's value property and listen for its typed valueChanged custom event.

The state type comes from an imported helper included when this example opens in the editor.

tsexport interface Selection {
  value: string;
}
export const initialSelection: Selection = { value: 'Paris' };