> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/uistroke.md).

# UIStroke

UIStroke : `Instance`

## Overview

UIStroke is an object that displays a stroke along the border of its parent UI object or around text. You can configure properties such as the stroke color, thickness, transparency, position, and corner join style to emphasize UI elements or improve their visibility.

To use UIStroke, place it as a child of the UI object to which you want to apply an outline, such as a Frame or TextLabel.

## Properties

### ApplyStrokeMode

`Enum.ApplyStrokeMode`

Specifies how the stroke is applied to the parent UI element.

* `Border`: Displays the stroke along the border of the parent UI element.
* `Contextual`: Displays the stroke in an appropriate area depending on the type of the parent UI element. For text UI elements, the stroke is displayed around the text.

Contextual can only be set for text UI elements such as TextLabel and TextButton.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
```

### BorderOffset

`UDim`

Adjusts the position of the stroke relative to the border of the parent UI element.

`Scale` represents a proportion of the parent UI element's size, while `Offset` represents an additional distance in pixels. The value is specified in the `UDim.new(scale, offset)` format.

This property can only be specified when the stroke is displayed along the border of the parent UI element.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.BorderOffset = UDim.new(0, 10)
```

### BorderStrokePosition

`Enum.BorderStrokePosition`

Specifies where the stroke is displayed relative to the border of the parent UI element.

* `Inner`: Displays the stroke inside the border.
* `Center`: Displays the stroke centered on the border.
* `Outer`: Displays the stroke outside the border.

This property can only be specified when the stroke is displayed along the border of the parent UI element.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.BorderStrokePosition = Enum.BorderStrokePosition.Outer
```

### Color

`Color3`

Specifies the color applied to the stroke.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")
UIStroke.Color = Color3.fromRGB(255, 0, 0)
```

### Enabled

`boolean`

Specifies whether the stroke is displayed.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.Enabled = false
```

### LineJoinMode

`Enum.LineJoinMode`

Specifies how stroke segments are joined at corners.

* `Round`: Joins corners with a rounded shape.
* `Bevel`: Joins corners with a beveled shape.
* `Miter`: Joins corners with a sharp shape.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.LineJoinMode = Enum.LineJoinMode.Round
```

### StrokeSizingMode

`Enum.StrokeSizingMode`

Specifies how the stroke thickness is calculated when the size of the parent UI element changes.

* `FixedSize`: Maintains a constant stroke thickness regardless of the size of the parent UI element.
* `ScaledSize`: Adjusts the stroke thickness proportionally to the size of the parent UI element.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.StrokeSizingMode = Enum.StrokeSizingMode.FixedSize
```

### Thickness

`number`

Specifies the thickness of the stroke.

Higher values display a thicker stroke. The actual appearance may be affected by the StrokeSizingMode setting.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.Thickness = 5
```

### Transparency

`number`

Specifies the transparency of the stroke.

A value of 0 represents a fully opaque stroke, while 1 represents a fully transparent stroke.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.Transparency = 0.5
```

### ZIndex

`number`

Specifies the display priority when the stroke overlaps with other UIStroke objects.

Higher values are displayed with higher priority.

This property can only be specified when the stroke is displayed along the border of the parent UI element.

#### Code Samples

```lua
local TextLabel = script.Parent
local UIStroke = TextLabel:WaitForChild("UIStroke")

UIStroke.ZIndex = 10
```

## Methods

## Events

## See also

{% content-ref url="/pages/Hgp8bh8C44modKPwUBkg" %}
[GUI](/manual/studio-manual/gui.md)
{% endcontent-ref %}
