Last updated September 14th 2009
BMML is the Balsamiq Mockups Markup Language, the flavor of XML used by Balsamiq Mockups to save its data.
This document outlines the BMML file format, in the hope that this will be useful to you when integrating Mockups in your daily work. You could for instance import BMML into your tool, write a BMML parser which generates HTML or MXML or XAML or running code...the sky is the limit!
Remember that XML syntax is case-sensitive. <tag> and <Tag> are different.
Here's a sample BMML containing a single Callout control:
<mockup version="1.0" skin="sketch" measuredW="941" measuredH="169" mockupW="36" mockupH="40">
<controls>
<control controlID="1" controlTypeID="com.balsamiq.mockups::CallOut" x="644" y="129" w="-1" h="-1"
measuredW="36" measuredH="40" zOrder="1" locked="false" isInGroup="-1">
<controlProperties>
<text>Hello!</text>
<backgroundAlpha>0.25</backgroundAlpha>
<color>65280</color>
</controlProperties>
</control>
</controls>
</mockup>
As you can see, the top-level tag is a 'mockup' tag. Within it, there's a 'controls' tag, which includes a list of 'control' elements, one for each control in the mockup. Each control elements can include an optional 'controlProperties' element, with different children depending on the type of element.
We will see below what all the attributes mean in details.
Here's the DTD snippet for the mockup tag:
<!ELEMENT mockup ( controls? ) > <!ATTLIST mockup measuredW NMTOKEN #REQUIRED > <!ATTLIST mockup measuredH NMTOKEN #REQUIRED > <!ATTLIST mockup mockupW NMTOKEN #REQUIRED > <!ATTLIST mockup mockupH NMTOKEN #REQUIRED > <!ATTLIST mockup skin NMTOKEN #REQUIRED > <!ATTLIST mockup version NMTOKEN #REQUIRED > <!ELEMENT controls ( control? ) >
A 'mockup' tag includes a 'controls' tag, described below.
measuredW and measuredH are the dimensions, in pixels, of the mockup, including the top-left white space around it.
mockupW and mockupH (added on 9/14/2009) are the dimensions of the mockup without any space around it. In other words, this would be the size of the PNG if you exported it.
The skin tag is not used right now, and is always "sketch".
The version tag is for the version of the BMML specification, which is 1.0 so far.
The controls tag is simple, it doesn't have any attributes and just contains a list of 'control' tags.
Here's the DTD snippet for the control tag:
<!ELEMENT control ( controlProperties? ) > <!ATTLIST control controlID NMTOKEN #REQUIRED > <!ATTLIST control controlTypeID NMTOKEN #REQUIRED > <!ATTLIST control w NMTOKEN #FIXED "-1" > <!ATTLIST control h NMTOKEN #FIXED "-1" > <!ATTLIST control measuredH NMTOKEN #REQUIRED > <!ATTLIST control measuredW NMTOKEN #REQUIRED > <!ATTLIST control x NMTOKEN #REQUIRED > <!ATTLIST control y NMTOKEN #REQUIRED > <!ATTLIST control zOrder NMTOKEN #REQUIRED > <!ATTLIST control isInGroup NMTOKEN #FIXED "-1" > <!ATTLIST control locked NMTOKEN #FIXED "false" >
The control tag can contain a controlProperties tag, described below.
controlID is always unique for this list of controls and identifies this control's instance in the mockup
controlTypeID is the control type (listed below).
w and h represent the size in pixels of the control. A value of -1 means that you should look at measuredW or measuredH instead.
measuredW and measuredH represent the size in pixels of the control, when shown in its 'natural state', i.e. it's the preferred dimension of the control as dictated by the control itself. For instance, for a Label control, measuredW would be large enough to show the whole text with no cropping.
x and y represent the position in pixels of the control, relative to the top-left corner of the canvas.
zOrder represents the layer ordering of this control. Values are unique and sequential within the current list of controls.
isInGroup tells you if a control is part of a group (-1 means "no", otherwise it uses the controlID of the group)
locked tells is a flag that tells you...you guessed it!
The controlProperties tag contains a child for each property that can be modified for a control (using the property inspector).
Here's a list of the different control properties and where they are used:
All the control type IDs start with the "com.balsamiq.mockups::" prefix. Here's the full list of the control type IDs supported as of today (case sensitive): Accordion, Alert, Arrow, BarChart, BreadCrumbs, BrowserWindow, Button, ButtonBar, Calendar, CallOut, Canvas, CheckBox, CheckBoxGroup, ColorPicker, ColumnChart, ComboBox, CoverFlow, DataGrid, DateChooser, FieldSet, FormattingToolbar, HCurly, HelpButton, HorizontalScrollBar, HRule, HSlider, HSplitter, Icon, IconLabel, Image, iPhone, iPhoneKeyboard, iPhoneMenu, iPhonePicker, Label, LineChart, Link, LinkBar, List, Map, MediaControls, Menu, MenuBar, ModalScreen, MultilineButton, NumericStepper, Paragraph, PieChart, PointyButton, ProgressBar, RadioButton, RadioButtonGroup, RedX, RoundButton, ScratchOut, SearchBox, StickyNote, Switch, TabBar, TagCloud, TextArea, TextInput, Title, TitleWindow, Tooltip, Tree, VerticalTabBar, VerticalScrollBar, VideoPlayer, VCurly, VSplitter, VolumeSlider, VRule, VSlider, Webcam
Here's a full list of the icon IDs supported as of today (case-sensitive): AddPageIcon, AlarmClockIcon, Alert2Icon, AlertIcon, ArchiveIcon, BackSpaceIcon, BaloonIcon, BatteryIcon, BoldIcon, BookIcon, BulletsIcon, CalendarIcon, CameraIcon, CartIcon, CellBarsIcon, CellPhoneIcon, CheckMarkIcon, CircledMinusIcon, CircledPlusIcon, CircledXIcon, ClockIcon, ColumnsIcon, ContactIcon, ContactsIcon, CopyIcon, CopyrightIcon, CoverFlowIcon, CreativeCommonsIcon, CursorIcon, CutIcon, DashIcon, DataBaseIcon, DeliciousIcon, DocEmptyIcon, DocExcelIcon, DocPDFIcon, DocWordIcon, DollarIcon, DotIcon, DownArrowIcon, DownFillTriangleIcon, DownLeftArrowIcon, DownloadIcon, DownRightArrowIcon, DownTriangleIcon, EllipsisIcon, EmailIcon, EmoticonIcon, EuroIcon, EyeIcon, FileIcon, FlagIcon, FolderClosed, FolderIcon, ForwardChapterIcon, ForwardIcon, FullScreenIcon, GearIcon, GeoLocationIcon, GridIcon, GtCircledIcon, GtIcon, HandClosedIcon, HandOpenIcon, HandPointIcon, HelpIcon, HLinesIcon, HomeIcon, HourGlassIcon, ImageIcon, IndentIcon, Info2Icon, InfoIcon, ItalicIcon, JewelIcon, JumpBackIcon, JumpOutIcon, LeftArrowIcon, LeftFillTriangleIcon, LeftTriangleIcon, LightBulbIcon, LineIcon, LinkGlobeIcon, LinkIcon, ListIcon, LockIcon, LockOpenIcon, MicIcon, MinusIcon, NumberedListIcon, OutdentIcon, PagesIcon, PaperClipIcon, PasteIcon, PauseIcon, PencilIcon, PlusBigIcon, PlusIcon, PortletEditIcon, PortletHelpIcon, PortletMaximizeIcon, PortletMinimizeIcon, PoundIcon, PrintIcon, PushPinIcon, RedoIcon, RegisteredIcon, ReloadIcon, RewindChapterIcon, RewindIcon, RightArrowIcon, RightFillTriangleIcon, RightTriangleIcon, RSSIcon, SadFaceIcon, SaveIcon, ScreenIcon, SearchIcon, ShapesIcon, ShiftIcon, SkypeIcon, SmallClockIcon, SpinningIcon, SquaredMinusIcon, SquaredPlusIcon, StarIcon, StopIcon, StrikeThroughIcon, TableIcon, TapeIcon, TelephoneIcon, TextAlignCenterIcon, TextAlignLeftIcon, TextAlignRightIcon, ThreeGIcon, ThumbnailsIcon, TrademarkIcon, TrashIcon, UnderlineIcon, UndoIcon, UpArrowIcon, UpFillTriangleIcon, UpLeftArrowIcon, UpRightArrowIcon, UpTriangleIcon, UserIcon, UsersIcon, VideoCameraIcon, VLinesIcon, VolumeIcon, WirelessIcon, WriteIcon, XIcon