Skip to main content

ImGui Enums

XFrames exposes Dear ImGui and ImPlot C++ enums as TypeScript enums. These are used in style rules, theme definitions, and plot component props.

import { ImGuiCol, ImGuiStyleVar, ImGuiDir, ImPlotMarker, ImPlotScale } from "@xframes/common";

ImGuiCol​

53 color IDs used in theme colors maps and per-widget style colors overrides. See the Theming guide — ImGuiCol reference for the full table.

// In a theme definition
colors: {
[ImGuiCol.Text]: ["#ffffff", 1],
[ImGuiCol.WindowBg]: ["#1a1a2e", 1],
}

// In a per-widget style rule
colors: {
[ImGuiCol.Button]: ["#e94560", 1],
[ImGuiCol.ButtonHovered]: ["#ff6b6b", 1],
}

ImGuiStyleVar​

32 numeric style properties. Each is either a float (single number) or ImVec2 (object with x, y).

Global​

EnumValueTypeDescription
Alpha0floatGlobal alpha (transparency)
DisabledAlpha1floatAlpha for disabled elements

Window​

EnumValueTypeDescription
WindowPadding2ImVec2Padding inside windows
WindowRounding3floatCorner rounding for windows
WindowBorderSize4floatWindow border thickness
WindowMinSize5ImVec2Minimum window size
WindowTitleAlign6ImVec2Title bar text alignment

Child windows & popups​

EnumValueTypeDescription
ChildRounding7floatCorner rounding for child windows
ChildBorderSize8floatChild window border thickness
PopupRounding9floatCorner rounding for popups
PopupBorderSize10floatPopup border thickness

Frames (inputs, checkboxes, sliders)​

EnumValueTypeDescription
FramePadding11ImVec2Padding inside frame elements
FrameRounding12floatCorner rounding for frames
FrameBorderSize13floatFrame border thickness

Spacing​

EnumValueTypeDescription
ItemSpacing14ImVec2Spacing between widgets
ItemInnerSpacing15ImVec2Spacing within composite widgets
IndentSpacing16floatHorizontal indent for tree nodes
CellPadding17ImVec2Padding inside table cells

Scrollbar & grab​

EnumValueTypeDescription
ScrollbarSize18floatScrollbar width
ScrollbarRounding19floatScrollbar corner rounding
GrabMinSize20floatMinimum grab handle size
GrabRounding21floatGrab handle corner rounding

Tabs​

EnumValueTypeDescription
TabRounding22floatTab corner rounding
TabBorderSize23floatTab border thickness
TabBarBorderSize24floatTab bar border thickness

Tables​

EnumValueTypeDescription
TableAngledHeadersAngle25floatAngle for angled table headers
TableAngledHeadersTextAlign26ImVec2Text alignment in angled headers

Text alignment​

EnumValueTypeDescription
ButtonTextAlign27ImVec2Text alignment inside buttons
SelectableTextAlign28ImVec2Text alignment in selectables

Separators​

EnumValueTypeDescription
SeparatorTextBorderSize29floatSeparator text border thickness
SeparatorTextAlign30ImVec2Separator text alignment
SeparatorTextPadding31ImVec2Separator text padding

Usage​

// float values — single number
vars: {
[ImGuiStyleVar.FrameRounding]: 8,
[ImGuiStyleVar.Alpha]: 0.95,
}

// ImVec2 values — { x, y } object
vars: {
[ImGuiStyleVar.FramePadding]: { x: 16, y: 8 },
[ImGuiStyleVar.ItemSpacing]: { x: 8, y: 6 },
}

ImGuiDir​

Direction values used by style properties like windowMenuButtonPosition and colorButtonPosition.

EnumValueDescription
None-1No direction
Left0Left
Right1Right
Up2Up
Down3Down

ImPlotMarker​

Marker shapes for plot data points. Used in plot series configuration.

EnumValueShape
None-1No marker
Circle0Circle
Square1Square
Diamond2Diamond
Up3Upward triangle
Down4Downward triangle
Left5Left triangle
Right6Right triangle
Cross7Cross (×)
Plus8Plus (+)
Asterisk9Asterisk (*)

ImPlotScale​

Axis scale types for plot axes.

EnumValueDescription
Linear0Linear scale (default)
Time1Time/date scale
Log102Base-10 logarithmic scale
SymLog3Symmetric logarithmic scale (handles negative values)

ImPlotColormap​

Color palettes for ImPlot visualizations. Used by the PlotHeatmap colormap prop. There is no TypeScript enum for this — pass the numeric value directly.

NameValueDescription
Deep0Default deep colors
Dark1Dark palette
Pastel2Pastel/soft colors
Paired3Paired color scheme
Viridis4Viridis (default for heatmaps)
Plasma5Plasma
Hot6Hot (red-yellow-white)
Cool7Cool (cyan-magenta)
Pink8Pink tones
Jet9Jet (blue-cyan-yellow-red)
Twilight10Twilight
RdBu11Red-Blue diverging
BrBG12Brown-BlueGreen diverging
PiYG13Pink-YellowGreen diverging
Spectral14Spectral
Greys15Greyscale
// Use Plasma colormap for a heatmap
<XFrames.PlotHeatmap ref={ref} colormap={5} scaleMin={0} scaleMax={100} />

// Use Viridis (default)
<XFrames.PlotHeatmap ref={ref} colormap={4} />

Next steps​