Skip to content
Cocktail is a cross-platform library for the HaXe programming language. It bridges the gap between all the targets supported by haXe, removing inconsistencies behind a common API. With it, the same code base is used to deploy to these targets: Flash, javaScript, PHP
Haxe Other
Find file
New pull request
Pull request Compare This branch is 112 commits behind silexlabs:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Cocktail, an HTML/CSS rendering engine for the Haxe language

  • Cocktail is implementing the W3C HTML and CSS standards in Haxe.

  • With Cocktail, write HTML/CSS applications in Haxe and build them for NME and flash/Air. As Cocktail uses the standard DOM API, you can also build your app to regular JavaScript.

  • Use it by embedding it inside your app/game, like a webview, and create your UI in HTML/CSS.

Project home page

For tutorials, demos and community support :

See you there !

Interactive demo

If you want to try cocktail in your browser :


Cocktail is a library for the Haxe programming language, you should be familiar with it to use Cocktail. Being familiar with NME (another Haxe library) can also help but is not required to use Cocktail.


  1. Cocktail is written for Haxe 3, you need to download and install it first:

  2. Cocktail is available on haxelib, once Haxe is installed, open you command prompt and type:

    haxelib install cocktail

  3. Optionnaly, if you also want to build for NME as well as flash/Air :

    haxelib install nme

  4. You can build now ! Haxe uses .hxml files to build projects. You should start with the samples provided in the folder of the cocktail haxelib. Haxelibs are installed in the folder of your Haxe installation. Each sample has a build folder containing .hxml files. To build, open you command prompt and type :

    haxe mybuildfile.hxml

    If you're on windows, you can just double-click the .hxml file instead.

  5. If you've made it this far, you should check the getting started tutorial !


This project has been used in production by core members of the project which could easily debug it. So it's getting stable but expect quirks, especially when using some tricky CSS layout. The API however, as it is based on the W3C standards is very stable.

Haxe 2

For Haxe 2 users, cocktail is also available on haxelib, although the Haxe 2 version won't be maintained.


Cocktail is open-source, released under the MIT licence, see licence.txt.

Lead developer : Yannick Dominguez
Something went wrong with that request. Please try again.