Known direct subclasses
DrawStyleScope

An interface that introduces the drawing property to a Style receiver scope.

Known indirect subclasses
StyleScope

A StyleScope is the receiver scope of a Style lambda.


An interface that introduces border properties to a Style receiver scope interface.

See also
StyleScope

Summary

Public functions

Unit

Sets the brush used to paint the border around the component.

Cmn
Unit

Sets the color of the border around the component.

Cmn
Unit
borderWidth(value: Dp)

Sets the width of the border around the component.

Cmn

Extension functions

Unit

Sets a border for the component with the specified width and brush.

Cmn
Unit

Sets a solid border for the component with the specified width and color.

Cmn

Public functions

borderBrush

fun borderBrush(value: Brush): Unit

Sets the brush used to paint the border around the component. The border is drawn on top of the background and the padded content. This method only sets the brush; width must be set separately. The border's presence and appearance do not affect the component's layout size.

This property is not inherited

Parameters
value: Brush

The brush to paint the border (e.g., for gradients).

borderColor

fun borderColor(value: Color): Unit

Sets the color of the border around the component. The border is drawn on top of the background and the padded content. This method only sets the color; width must be set separately. The border's presence and appearance do not affect the component's layout size.

This property is not inherited

Parameters
value: Color

The color of the border.

borderWidth

fun borderWidth(value: Dp): Unit

Sets the width of the border around the component. The border is drawn on top of the background and the padded content. The border's width does not contribute to the component's layout size (width/height); it is rendered within the component's bounds This method only sets the width; color or brush must be set separately.

Specifying a Dp.Unspecified value will remove the border.

Specifying a Dp.Hairline or 0.dp value will create 1 pixel border regardless of density.

This property is not inherited

Parameters
value: Dp

The width of the border.

Extension functions

BorderScope.border

@ExperimentalFoundationStyleApi
fun BorderScope.border(width: Dp, brush: Brush): Unit

Sets a border for the component with the specified width and brush. The border is drawn on top of the background and the padded content. The border itself does not contribute to the component's layout size (width/height).

Specifying a Dp.Unspecified width will remove the border.

Specifying a Dp.Hairline or 0.dp width will create 1 pixel border regardless of density.

This property is not inherited

Parameters
width: Dp

The width of the border.

brush: Brush

The brush to paint the border (e.g., for gradients).

BorderScope.border

@ExperimentalFoundationStyleApi
fun BorderScope.border(width: Dp, color: Color): Unit

Sets a solid border for the component with the specified width and color. The border is drawn on top of the background and the padded content. The border itself does not contribute to the component's layout size (width/height).

Specifying a Dp.Unspecified width will remove the border.

Specifying a Dp.Hairline or 0.dp width will create 1 pixel border regardless of density.

This property is not inherited

Parameters
width: Dp

The width of the border.

color: Color

The color of the border.