Rectangle

Rectangle component for rendering solid colored rectangles

import { Rectangle } from "@roku-sdk/components";
Rectangle(props: IRectangleProps): JSX.Element

Description

Rectangle component for rendering solid colored rectangles.

Rectangle is a renderable node that draws a solid colored rectangle. It is one of the three basic renderable nodes in SceneGraph and is commonly used for backgrounds, borders, and simple UI elements.

Parameters

NameTypeDescription
propsIRectangleProps

Example

<rectangle
    width={400}
    height={200}
    color="#FF0000FF"
/>

Types

IRectangleProps

Properties for the Rectangle node.

Rectangle is a renderable node that draws a solid colored rectangle. It is one of the three basic renderable nodes in SceneGraph and is commonly used for backgrounds, borders, and simple UI elements.

NameTypeDescription
blendingEnabled?booleanSpecifies if the rectangle should be alpha blended with the nodes that are behind it.
color?stringSpecifies the color of the rectangle (string containing hex value e.g. RGBA).
effect?ElementAn Effect node to apply shader-based rendering (rounded corners, borders, gradients). On platforms that do not support effects, this is silently ignored.
height?ResType<number>Specifies the height of rectangle in local coordinates.
width?ResType<number>Specifies the width of the rectangle in local coordinates.

Extends IGroupProps.


What’s Next

Did this page help you?