Skip to content

Class · inherits UIComponent

UIShadow

Official docs ↗

Renders configurable shape or text shadows for the parent UI instance.

About UIShadow

UIShadow renders a shadow for its parent UI instance. Key features include:

  • Adjust the shadow's blurriness with BlurRadius.
  • Adjust the shadow's color and transparency with Color and Transparency.
  • Adjust the shadow's position and size relative to the parent with Offset and Spread.
  • Add multiple shadows under the same parent and adjust their render order with ZIndex.
  • Add a shadow to the text in TextLabel, TextButton, or TextBox with Mode.
  • Add an inset shadow with Inset.
  • Hide the part of the shadow directly behind the parent with ShowBehindParent.
  • Apply a gradient to a shadow's color with a child UIGradient.
  • If the parent is rotated with GuiObject.Rotation, the shadow will also be rotated.
  • If the parent has round corners with UICorner, the shadow will also have round corners.

Limitations

  • UIShadow does not support Path2D.
  • You cannot apply textures to a UIShadow.

Properties 10

  • BlurRadius: UDimDetermines the shadow's blurriness.

    This property determines the shadow's blurriness. A larger value makes the shadow's edges appear softer.

    Note that the scale factor of this UDim property is relative to the parent's width or height, whichever is shorter. This property must also be non-negative; a negative value will be treated as 0.

  • Color: Color3Determines the shadow's color.

    This property determines the shadow's color.

  • Enabled: booleanDetermines whether the UIShadow is visible.

    This property determines whether the UIShadow is visible. Default is true.

  • Inset: booleanDetermines whether the UIShadow is an inset shadow.

    When true, the shadow appears on top of and inside the parent. When false, the shadow appears behind the parent.

    Defaults to false. This property has no effect when Mode is ApplyShadowMode.Text.

  • Mode: ApplyShadowModeDetermines whether the UIShadow applies to the parent's shape or text.

    Determines whether the shadow applies to the parent's shape or text. Defaults to ApplyShadowMode.Shape, which renders a shadow for the parent's rectangular area.

    ApplyShadowMode.Text renders a shadow for text in a TextLabel, TextButton, or TextBox. On other classes, text mode renders no shadow.

    Shape mode and Text mode shadows can coexist under the same parent.

    The following properties have no effect in text mode:

  • Offset: UDim2Moves the shadow relative to the parent's position.

    This property moves the shadow relative to the parent's position. The X scale factor is relative to the parent's width, and the Y scale factor is relative to the parent's height.

  • ShowBehindParent: booleanDetermines whether the shadow renders directly behind the parent.

    When true, the entire shadow is rendered. When false, the parent's shape masks the portion of the shadow directly behind it. Disabling this property prevents a shadow from obscuring content behind a transparent parent.

    Defaults to true. This property has no effect when Mode is ApplyShadowMode.Text or Inset is true.

  • Spread: UDim2Expands or shrinks the shadow relative to the parent's size.

    This property expands or shrinks the shadow relative to the parent's size. The X scale factor is relative to the parent's width, and the Y scale factor is relative to the parent's height. Properties that are relative to the parent's size, such as the scale factors of BlurRadius and Offset, are not affected by Spread.

    This property has no effect when Mode is ApplyShadowMode.Text.

    When Inset is true, positive Spread values expand the shadow toward the center of the parent instead of outward.

  • Transparency: floatSets the shadow's transparency.

    This property sets the shadow's transparency, with 0 being fully opaque and 1 being fully transparent.

  • ZIndex: intDetermines the shadow's render order relative to sibling UIShadow instances.

    If a UI instance has multiple shadows, they are rendered in order of increasing ZIndex. Since all shadows are rendered below the parent instance, ZIndex can only be negative.

UIShadow also has every member of UIComponent. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.