BorderScope

Known direct subclasses
DrawStyleScope

This interface is deprecated. This scope type is being removed.

Known indirect subclasses
StyleScope

This interface is deprecated. This scope type is being removed.


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

See also
StyleScope

Summary

Public functions

Unit

This function is deprecated. This scope type is being removed.

Cmn
Unit

This function is deprecated. This scope type is being removed.

Cmn
Unit
borderWidth(value: Dp)

This function is deprecated. This scope type is being removed.

Cmn

Extension functions

Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

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).

See also
borderWidth
borderColor
border

(Dp, Brush)

border

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.