Skip to main content Svelte Highlight v7.21.1

Blueprint language preview

1. A simple window

a template, a nested widget, and a signal handler
horizon-dark
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}
atom-one-dark
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}
github-dark
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}
dracula
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}
nord
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}
github
using Gtk 4.0;

template $MyWidget : Adw.Window {
  title: _("My App");

  Gtk.Box box {
    orientation: vertical;
    styles ["card"]

    Gtk.Button button {
      label: "Click me";
      clicked => $on_clicked() swapped;
    }
  }
}

2. Bindings

bind and bind-property between widgets
horizon-dark
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}
atom-one-dark
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}
github-dark
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}
dracula
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}
nord
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}
github
Gtk.Label label {
  label: bind button.label;
  visible: bind-property button.visible inverted;
}

3. Menus

the menu and section keywords
horizon-dark
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}
atom-one-dark
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}
github-dark
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}
dracula
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}
nord
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}
github
menu my_menu {
  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }
  }
}