Hyperview

Hyperview

  • Guides
  • Examples
  • Reference
  • Blog

›Behaviors

Reference

  • Index

Behaviors

  • Behavior Attributes
  • <behavior>
  • Alert
  • Share

Display Elements

  • <doc>
  • <screen>
  • <header>
  • <body>
  • <view>
  • <text>
  • <image>
  • <list>
  • <section-list>
  • <section>
  • <section-title>
  • <items>
  • <item>
  • <spinner>
  • <web-view>

Input Elements

  • <form>
  • <text-field>
  • <select-single>
  • <select-multiple>
  • <option>
  • <picker-field>
  • <picker-item>
  • <switch>
  • <date-field>

Style Elements

  • <styles>
  • <style>
  • <modifier>

Hyperview Client

  • Hyperview component
  • Custom elements
  • Custom behaviors
  • Loading Screen

Hyperview Navigation

  • <navigator>
  • <nav-route>

<behavior>

The <behavior> element allows adding multiple behaviors to UI elements such as <view>, <text>, <image>, etc.

<view style="Button">
  <behavior trigger="press" href="/display" />
  <behavior trigger="longPress" href="/edit" target="new" />
  <text style="Button__Label">Item</text>
</view>

The example above shows a button with two behaviors:

  • When the button is pressed, we request "/display" and push the content as a new screen.
  • When the button is long-pressed, we request "/edit" and show the content as a modal.

<behavior> elements can be mixed with behavior attributes on the parent element. The example below works the same as the one above.

<view style="Button" trigger="press" href="/display">
  <behavior trigger="longPress" href="/edit" target="new" />
  <text style="Button__Label">Item</text>
</view>

Structure

A <behavior> element defines a behavior that applies to its direct parent element. The following elements can contain <behavior> elements as a direct child:

  • <view>
  • <text>
  • <image>
  • <list>
  • <section-list>
  • <option>

Attributes

  • Behavior attributes

Behavior attributes

A <behavior> element accepts the standard behavior attributes. The supported triggers depend on the parent element.

← Behavior AttributesAlert →
  • Structure
  • Attributes
Hyperview
Docs
ExamplesHyperview Reference
More
BlogGitHub
Copyright © 2025 Instawork