# Sandbox.Graphics.DrawRoundedRectangle

```csharp
static void DrawRoundedRectangle(in Rect rect, in Color color, in Vector4 cornerRadius = null, in Vector4 borderWidth = null, in Color borderColor = null)
```

Draw a rounded rectangle, with optional border, in Material.UI.Box. Corner radii are
(bottom-right, top-right, bottom-left, top-left); radii too big for the rect are scaled to fit, like CSS.
Border widths are left, top, right, bottom.

### Parameters

- `in rect` (`Rect`)
- `in color` (`Color`)
- `in cornerRadius` (`Vector4`), default `null`
- `in borderWidth` (`Vector4`), default `null`
- `in borderColor` (`Color`), default `null`

Declared in [Sandbox.Graphics](/api/Sandbox.Graphics).
Assembly: `Sandbox.Engine`.
