Skip to content

Defaults

Many of Roblox's built-in instance defaults are legacy choices that nearly every project overrides: parts spawn unanchored in Plastic, GUI objects draw borders, buttons auto-color, and layouts sort by name. To cut that boilerplate, Flux.new applies a curated set of default property overrides immediately after creating the instance, before your own properties are assigned.

IMPORTANT

This changes behavior compared to Instance.new: Flux.new "Part" {} creates an anchored, SmoothPlastic part, and Flux.new "TextButton" {} does not auto-color when pressed. If a freshly created instance behaves unexpectedly, check the table below.

Your own properties always win; defaults are applied first and overwritten by anything in your properties table. Flux.edit never applies defaults; they only apply to instances Flux creates.

Default Overrides

ClassOverrides
PartAnchored = true, Material = SmoothPlastic, Size = (1, 1, 1)
ScreenGui, BillboardGuiResetOnSpawn = false, ZIndexBehavior = Sibling
SurfaceGuiResetOnSpawn = false, ZIndexBehavior = Sibling, PixelsPerStud = 50, SizingMode = PixelsPerStud
Frame, ImageLabel, VideoFrame, ViewportFrameWhite BackgroundColor3, black BorderColor3, BorderSizePixel = 0
ScrollingFrameSame as Frame + black ScrollBarImageColor3
ImageButtonSame as Frame + AutoButtonColor = false
TextLabelSame as Frame + Font = SourceSans, Text = "", black TextColor3
TextBoxSame as TextLabel + ClearTextOnFocus = false
TextButtonSame as TextLabel + AutoButtonColor = false
UIListLayout, UIGridLayout, UITableLayout, UIPageLayoutSortOrder = LayoutOrder

CanvasGroup is intentionally left at Roblox's own defaults (it appears in Defaults.luau with no overrides), so a Flux.new "CanvasGroup" {} matches Instance.new("CanvasGroup").

The authoritative list lives in src/Defaults.luau.

Disabling Defaults

Set Flux.Flags.defaults = false once at startup to disable the system globally:

luau
local Flux = require(ReplicatedStorage.Flux)
Flux.Flags.defaults = false

-- From here on, new "Part" {} behaves exactly like Instance.new("Part")

Customizing Defaults

Flux.Defaults is a plain table; edit existing entries or register your own classes at startup to apply your project's conventions everywhere:

luau
Flux.Defaults.TextLabel.Font = Enum.Font.GothamMedium
Flux.Defaults.UICorner = { CornerRadius = UDim.new(0, 8) }

To opt out of a default without disabling the whole system, set it to nil: Flux.Defaults.Part.Anchored = nil drops just the anchoring override while keeping the rest, and Flux.Defaults.Part = nil clears the entire class.