Welcome to the Ape Design Language demonstration website. The Ape Design Language, or adl for short, is the UI design used by Ape Apps for multiple projects across platforms. It is made to give a consistent look and feel across the entire Ape Apps ecosystem. Although the adl is meant for use in Ape Apps products, you may freely use the styles and functions in your own works.
adl uses the Fluent UI System Icons icon font for various menus and toolbars. When the adl module is properly imported, this iconset will be available to your project. You can see a list of all supported icons in the Icon Font section of the sidebar.
The adl library is provided as a module that you import into your project. It utilizes npm and webpack for easy integration into modern web development workflows. You can find the source code and implementation documentation at the adl GitHub repository.
Desktop Shell
This site itself is built with adl.addAppShell. The shell owns the page layout, the top chrome, the sidebar toggle, and the optional bottom and ad-unit rows. Apps supply the toolbar items, title, and content; the shell decides whether those become one toolbar, a titlebar plus toolbar, or a split headerbar with a sidebar column, and whether the desktop Linux surface palette is used.
Platform Preview
These controls (and the matching URL parameters) override what ADL detects, so every platform variation can be tested in a normal browser tab. Simulated WCO reserves the native-control area and draws placeholder controls; a real window shows its actual system buttons there.
One toolbar on Linux, with the app icon dropped and titlebar items folded into the same row.
Split headerbar on Linux and macOS when a sidebar is present; Windows keeps the titlebar plus toolbar split and the sidebar below it.
Title visibility follows WCO: without it the native or browser titlebar owns the title, so the shell renders actions only.
macOS split keeps the sidebar transparent over the window backdrop and the content solid, with a left-aligned bold title.
Sidebar is optional; when omitted, content uses the full width and no toggle is added.
Windows collapse leaves a compact icon rail; Linux and macOS hide the sidebar column instead.
Below 600px the sidebar becomes an overlay drawer with a scrim; content stays full width and the drawer closes on outside tap, Escape or a nav-item click.
secondaryToolbar adds another action row under the main toolbar; omit it and the row disappears.
Dense toolbars collapse icon-only actions into a More menu when they do not fit; labeled items stay visible.
Sidebar overscroll gets its own header shadow on Linux and macOS; custom scrollbars replace the browser default everywhere.
adUnit and bottomBar are optional; the ad-unit row collapses when empty.
scrollElement drives the Linux header shadow; a sidebar gets its own header cell on Linux and macOS, with the toggle moved there on Linux.
tabs are placed by the shell: header on Windows, strip below the header on Linux/macOS, with an explicit placement override.
Theme and Style
Theme Color
let theme = "default"; // default, light or dark
let color = "#1565C0";
adl.setTheme(color,theme);
Menus and Toolbars
Toolbars
The way to create a toolbar is through code, and this example shows how and demonstrates many of the options and capabilities available for toolbar creation.
The iconWeight icon property lets you choose different weights for some of the icon fonts. Property name is iconWeight in all instances.
Iconography
The adl library supports image icons, emoji icons, or font icons using the Fluent UI System Icons icon set. The font icons are specified by using their icon name. To see a list of all available font icons, see the Icon Font section in the main sidebar.
Popup Menu
A nice popup menu that can be used as a context menu or in other situations.
adl.addSidebar renders a sidebar tree from item objects. Items can nest, expand and collapse, carry a trailing action button, show a color dot or subtitle, and provide a right-click context menu. ADL owns rendering and interaction; the app owns the item data and can persist open/selected state.
adl.addTabs renders a horizontal tab strip with active, dirty, close and new-tab controls. The app owns the tab list and active id; ADL renders and reports selection, close and new-tab requests. Overflow is horizontally scrollable.
When tabs are passed to addAppShell, the shell decides placement. Auto uses the titlebar row on Windows and a strip below the header on Linux/macOS. Use adl-tabs-placement to force either. On Windows header placement with WCO, the active tab and the app surface below it share --adl-tab-active-bg, so the selected tab connects to the toolbar, content and sidebar. Without WCO the tabs stay in the merged toolbar and are fully rounded instead.
The ADL modal dialog boxes come in a variety of styles and can be customized to fit many scenarios. There are also several helper functions to make creating a dialog a lot easier.
Alert Box (simple)
adl.showAlert("This is an alert box!");
Alert Box With Title (simple)
adl.showAlertWithTitle("This is the message!","This is the Title");
The above functions were all wrappers for the more complete showDialog function.
adl.showDialog({
title: "Dialog Box",
message: "This is the basic usage of the showDialog function. There are a lot of available options, allowing for complete customization of the dialog box. This one is using an ionic icon, but you can also specify an image URL for an icon.",
icon: "ic_fluent_animal_rabbit_20_regular",
iconColor: "#33691E",
buttons: [
{
text: "Button A"
},
{
text: "Button B",
color: "#4DB6AC"
},
{
text: "Button C",
color: "#f44336",
func: function(){ adl.showAlert("You picked C!"); }
}
],
});
Input Box (simple)
adl.inputBox({
title: "Input Box",
message: "An input box is an easy way to gather user input!",
multiline: false,
password: false,
placeholder: "Type something here!",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Multiline Input Box (simple)
adl.inputBox({
title: "Multiline Input Box",
message: "A multiline input box, for those times when you want to let the user type in a bit more info.",
multiline: true,
password: false,
placeholder: "Type something here!",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Password Box (simple)
adl.inputBox({
title: "Enter Password",
message: "Use the password flag to make an input box work as a password input.",
multiline: false,
password: true,
placeholder: "Enter password",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Custom Input Box
Ultimately, the inputBox function is another wrapper for the showDialog function, which can become an input box using the input related options below.
adl.showDialog({
title: "Custom Input Box",
message: "The showDialog function can also be used to create an input box. One of the buttons must have the inputResult option set in order to recieve the result text from the input.",
icon: "ic_fluent_drink_beer_20_regular",
iconColor: "#FFA000",
input: {
multiline: false,
password: false,
placeholder: "What ales you?"
},
buttons: [
{
text: "NOTHING!!",
color: "#f44336"
},
{
text: "Submit",
color: "#4CAF50",
inputResult: true,
func: function(result){ adl.showAlert("You typed: " + result); }
}
],
});
Slider Dialog
The dialog window can also be configured to provide a horizontal slider for selection of a number between two defined values.
adl.showDialog({
title: "Slider Dialog",
message: "Choose a value based on the slider. The onChange callback gives you the current value and an update function that allows you to change the status display as the user manipulates the slider. Give a button the sliderResult attribute to be passed the result of the slider.",
slider: {
min: 0,
max: 100,
value: 50,
status: "50 out of 100",
onChange: function(value,update) { update(value + " out of 100"); },
},
buttons: [
{
text: "Dismiss",
},
{
text: "Save",
color: "#AB47BC",
sliderResult: true,
func: function(result){ adl.showAlert("You choose: " + result); }
}
],
});
You can pass in a 2d array of hex colors to use as custom color swatches. Each array represents a row of swatches, and each must have the same number of colors.
These are more helper functions for the showDialog interface that let you easily display and manipulate a Please Wait type dialog that can be updated and dismissed on your command.
Just like the color picker, the list can also be embedded right into the document so that it's always available. Just pass in a dom element in your options. Items can also be added in "compact" mode.
Using the flyout options, the dialog box can also be positioned as a flyout element. When used as a flyout, clicking/tapping outside of the dialog will dismiss it. The flyout can take all of the same options as the regular dialog window.
adl.showDialog({
title: "Dialog Flyout",
message: "Flyout dialogs can come in handy in many situations. They can be used for settings screens, 'hamburger' type menus, or small informational popups.",
icon: "",
iconColor: "#FBC02D",
flyout: {
position: "bottom"
}
});