Menu

## BoxComponentBuilder
in package
implements ComponentBuilder

BoxComponentBuilder.php : 39

A builder class for box component.

### Interfaces, Classes and Traits

ComponentBuilder
  The interface that has a responsibility to build component.

### Table of Contents

$actionBuilder : TemplateActionBuilder
$alignItems : ComponentAlignItems
$backgroundAngle : string
$backgroundCenterColor : string
$backgroundCenterPosition : string
$backgroundColor : string
$backgroundEndColor : string
$backgroundStartColor : string
$backgroundType : ComponentBackgroundType
$borderColor : string
$borderWidth : string
$component : array<string|int, mixed>|null
$componentBuilders : array<string|int, ComponentBuilder>
$cornerRadius : string
$flex : int
$height : string
$justifyContent : ComponentJustifyContent
$layout : ComponentLayout
$margin : ComponentMargin
$maxHeight : string
$maxWidth : string
$offsetBottom : string
$offsetEnd : string
$offsetStart : string
$offsetTop : string
$paddingAll : string
$paddingBottom : string
$paddingEnd : string
$paddingStart : string
$paddingTop : string
$position : string
$spacing : ComponentSpacing
$width : string
__construct() : mixed
  BoxComponentBuilder constructor.
build() : array<string|int, mixed>
  Builds box component structure.
builder() : BoxComponentBuilder
  Create empty BoxComponentBuilder.
setAction() : $this
  Set action.
setAlignItems() : $this
  Set alignItems
setBackgroundAngle() : $this
  Set backgroundAngle
setBackgroundCenterColor() : $this
  Set backgroundCenterColor
setBackgroundCenterPosition() : $this
  Set backgroundCenterPosition
setBackgroundColor() : $this
  Set background color
setBackgroundEndColor() : $this
  Set backgroundEndColor
setBackgroundStartColor() : $this
  Set backgroundStartColor
setBackgroundType() : $this
  Set backgroundType
setBorderColor() : $this
  Set border color
setBorderWidth() : $this
  Set border width
setContents() : $this
  Set contents.
setCornerRadius() : $this
  Set corner radius
setFlex() : $this
  Set flex.
setHeight() : $this
  Set height
setJustifyContent() : $this
  Set justifyContent
setLayout() : $this
  Set laytout.
setMargin() : $this
  Set margin.
setMaxHeight() : $this
  Set maxHeight
setMaxWidth() : $this
  Set maxWidth
setOffsetBottom() : $this
  Set offsetBottom.
setOffsetEnd() : $this
  Set offsetEnd.
setOffsetStart() : $this
  Set offsetStart.
setOffsetTop() : $this
  Set offsetTop.
setPaddingAll() : $this
  Set paddingAll.
setPaddingBottom() : $this
  Set paddingBottom.
setPaddingEnd() : $this
  Set paddingEnd.
setPaddingStart() : $this
  Set paddingStart.
setPaddingTop() : $this
  Set paddingTop.
setPosition() : $this
  Set position.
setSpacing() : $this
  Set spacing.
setWidth() : $this
  Set width

### Properties

#### $actionBuilder

BoxComponentBuilder.php : 52
`private TemplateActionBuilder $actionBuilder`

#### $alignItems

BoxComponentBuilder.php : 96
`private ComponentAlignItems $alignItems`

#### $backgroundAngle

BoxComponentBuilder.php : 101
`private string $backgroundAngle`

#### $backgroundCenterColor

BoxComponentBuilder.php : 107
`private string $backgroundCenterColor`

#### $backgroundCenterPosition

BoxComponentBuilder.php : 109
`private string $backgroundCenterPosition`

#### $backgroundColor

BoxComponentBuilder.php : 66
`private string $backgroundColor`

#### $backgroundEndColor

BoxComponentBuilder.php : 105
`private string $backgroundEndColor`

#### $backgroundStartColor

BoxComponentBuilder.php : 103
`private string $backgroundStartColor`

#### $backgroundType

BoxComponentBuilder.php : 99
`private ComponentBackgroundType $backgroundType`

#### $borderColor

BoxComponentBuilder.php : 68
`private string $borderColor`

#### $borderWidth

BoxComponentBuilder.php : 70
`private string $borderWidth`

#### $component

BoxComponentBuilder.php : 112
`private array<string|int, mixed>|null $component`

#### $componentBuilders

BoxComponentBuilder.php : 44
`private array<string|int, ComponentBuilder> $componentBuilders`

#### $cornerRadius

BoxComponentBuilder.php : 72
`private string $cornerRadius`

#### $flex

BoxComponentBuilder.php : 46
`private int $flex`

#### $height

BoxComponentBuilder.php : 78
`private string $height`

#### $justifyContent

BoxComponentBuilder.php : 94
`private ComponentJustifyContent $justifyContent`

#### $layout

BoxComponentBuilder.php : 42
`private ComponentLayout $layout`

#### $margin

BoxComponentBuilder.php : 50
`private ComponentMargin $margin`

#### $maxHeight

BoxComponentBuilder.php : 80
`private string $maxHeight`

#### $maxWidth

BoxComponentBuilder.php : 76
`private string $maxWidth`

#### $offsetBottom

BoxComponentBuilder.php : 87
`private string $offsetBottom`

#### $offsetEnd

BoxComponentBuilder.php : 91
`private string $offsetEnd`

#### $offsetStart

BoxComponentBuilder.php : 89
`private string $offsetStart`

#### $offsetTop

BoxComponentBuilder.php : 85
`private string $offsetTop`

#### $paddingAll

BoxComponentBuilder.php : 55
`private string $paddingAll`

#### $paddingBottom

BoxComponentBuilder.php : 59
`private string $paddingBottom`

#### $paddingEnd

BoxComponentBuilder.php : 63
`private string $paddingEnd`

#### $paddingStart

BoxComponentBuilder.php : 61
`private string $paddingStart`

#### $paddingTop

BoxComponentBuilder.php : 57
`private string $paddingTop`

#### $position

BoxComponentBuilder.php : 83
`private string $position`

#### $spacing

BoxComponentBuilder.php : 48
`private ComponentSpacing $spacing`

#### $width

BoxComponentBuilder.php : 74
`private string $width`

### Methods

#### __construct()

BoxComponentBuilder.php : 123

BoxComponentBuilder constructor.

`public __construct(ComponentLayout|string|null $layout, array<string|int, ComponentBuilder>|null $componentBuilders[, int|null $flex = null ][, ComponentSpacing|string|null $spacing = null ][, ComponentMargin|null $margin = null ][, mixed $actionBuilder = null ]) : mixed`

##### Parameters

$layout : ComponentLayout|string|null
$componentBuilders : array<string|int, ComponentBuilder>|null
$flex : int|null = null
$spacing : ComponentSpacing|string|null = null
$margin : ComponentMargin|null = null
$actionBuilder : mixed = null

##### Return values

mixed —

#### build()

BoxComponentBuilder.php : 656

Builds box component structure.

`public build() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### builder()

BoxComponentBuilder.php : 144

Create empty BoxComponentBuilder.

`public static builder() : BoxComponentBuilder`

##### Return values

BoxComponentBuilder —

#### setAction()

BoxComponentBuilder.php : 215

Set action.

`public setAction(TemplateActionBuilder|null $actionBuilder) : $this`

##### Parameters

$actionBuilder : TemplateActionBuilder|null

##### Return values

$this —

#### setAlignItems()

BoxComponentBuilder.php : 561

Set alignItems

`public setAlignItems(string|ComponentAlignItems|null $alignItems) : $this`

##### Parameters

$alignItems : string|ComponentAlignItems|null

##### Return values

$this —

#### setBackgroundAngle()

BoxComponentBuilder.php : 588

Set backgroundAngle

`public setBackgroundAngle(string $backgroundAngle) : $this`

specifiable "**deg". (e.g. 90deg, 23.5deg

##### Parameters

$backgroundAngle : string

##### Return values

$this —

#### setBackgroundCenterColor()

BoxComponentBuilder.php : 630

Set backgroundCenterColor

`public setBackgroundCenterColor(string $backgroundCenterColor) : $this`

Hex color string: #RRGGBB or #RRGGBBAA

##### Parameters

$backgroundCenterColor : string

##### Return values

$this —

#### setBackgroundCenterPosition()

BoxComponentBuilder.php : 645

Set backgroundCenterPosition

`public setBackgroundCenterPosition(string $backgroundCenterPosition) : $this`

specifiable percentage (0%~100%). (e.g. 5%, 10.1%, 100%

##### Parameters

$backgroundCenterPosition : string

##### Return values

$this —

#### setBackgroundColor()

BoxComponentBuilder.php : 405

Set background color

`public setBackgroundColor(string|null $backgroundColor) : $this`

Hex color string: #RRGGBB or #RRGGBBAA

##### Parameters

$backgroundColor : string|null

##### Return values

$this —

#### setBackgroundEndColor()

BoxComponentBuilder.php : 616

Set backgroundEndColor

`public setBackgroundEndColor(string $backgroundEndColor) : $this`

Hex color string: #RRGGBB or #RRGGBBAA

##### Parameters

$backgroundEndColor : string

##### Return values

$this —

#### setBackgroundStartColor()

BoxComponentBuilder.php : 602

Set backgroundStartColor

`public setBackgroundStartColor(string $backgroundStartColor) : $this`

Hex color string: #RRGGBB or #RRGGBBAA

##### Parameters

$backgroundStartColor : string

##### Return values

$this —

#### setBackgroundType()

BoxComponentBuilder.php : 573

Set backgroundType

`public setBackgroundType(string|ComponentBackgroundType|null $backgroundType) : $this`

##### Parameters

$backgroundType : string|ComponentBackgroundType|null

##### Return values

$this —

#### setBorderColor()

BoxComponentBuilder.php : 419

Set border color

`public setBorderColor(string|null $borderColor) : $this`

Hex color string: #RRGGBB or #RRGGBBAA

##### Parameters

$borderColor : string|null

##### Return values

$this —

#### setBorderWidth()

BoxComponentBuilder.php : 436

Set border width

`public setBorderWidth(ComponentBorderWidth|string|null $borderWidth) : $this`

specifiable pixel and keyword. (e.g. pixel: 5px keyword: none (defined in ComponentBorderWidth)

##### Parameters

$borderWidth : ComponentBorderWidth|string|null

##### Return values

$this —

#### setContents()

BoxComponentBuilder.php : 167

Set contents.

`public setContents(array<string|int, ComponentBuilder> $componentBuilders) : $this`

##### Parameters

$componentBuilders : array<string|int, ComponentBuilder>

##### Return values

$this —

#### setCornerRadius()

BoxComponentBuilder.php : 453

Set corner radius

`public setCornerRadius(ComponentSpacing|string|null $cornerRadius) : $this`

specifiable pixel and keyword. (e.g. pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$cornerRadius : ComponentSpacing|string|null

##### Return values

$this —

#### setFlex()

BoxComponentBuilder.php : 179

Set flex.

`public setFlex(int|null $flex) : $this`

##### Parameters

$flex : int|null

##### Return values

$this —

#### setHeight()

BoxComponentBuilder.php : 515

Set height

`public setHeight(string|null $height) : $this`

specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px

※In horizontal and baseline box, `flex` property is ignored and the value is regarded as 0

##### Parameters

$height : string|null

##### Return values

$this —

#### setJustifyContent()

BoxComponentBuilder.php : 549

Set justifyContent

`public setJustifyContent(string|ComponentJustifyContent|null $justifyContent) : $this`

##### Parameters

$justifyContent : string|ComponentJustifyContent|null

##### Return values

$this —

#### setLayout()

BoxComponentBuilder.php : 155

Set laytout.

`public setLayout(ComponentLayout|string $layout) : $this`

##### Parameters

$layout : ComponentLayout|string

##### Return values

$this —

#### setMargin()

BoxComponentBuilder.php : 203

Set margin.

`public setMargin(ComponentMargin|string|null $margin) : $this`

##### Parameters

$margin : ComponentMargin|string|null

##### Return values

$this —

#### setMaxHeight()

BoxComponentBuilder.php : 537

Set maxHeight

`public setMaxHeight(string|null $maxHeight) : $this`

specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px

※If the height of the box calculated from the height property is greater than the height of the box calculated from the maxHeight property, the height of the box will shrink to the value specified by the maxHeight property.

##### Parameters

$maxHeight : string|null

##### Return values

$this —

#### setMaxWidth()

BoxComponentBuilder.php : 495

Set maxWidth

`public setMaxWidth(string|null $maxWidth) : $this`

specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px

※If the width of the box calculated from the width property is greater than the width of the box calculated from the maxWidth property, the width of the box will shrink to the value specified by the maxWidth property.

##### Parameters

$maxWidth : string|null

##### Return values

$this —

#### setOffsetBottom()

BoxComponentBuilder.php : 355

Set offsetBottom.

`public setOffsetBottom(string|ComponentSpacing|null $offsetBottom) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$offsetBottom : string|ComponentSpacing|null

##### Return values

$this —

#### setOffsetEnd()

BoxComponentBuilder.php : 391

Set offsetEnd.

`public setOffsetEnd(string|ComponentSpacing|null $offsetEnd) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$offsetEnd : string|ComponentSpacing|null

##### Return values

$this —

#### setOffsetStart()

BoxComponentBuilder.php : 373

Set offsetStart.

`public setOffsetStart(string|ComponentSpacing|null $offsetStart) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$offsetStart : string|ComponentSpacing|null

##### Return values

$this —

#### setOffsetTop()

BoxComponentBuilder.php : 337

Set offsetTop.

`public setOffsetTop(string|ComponentSpacing|null $offsetTop) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$offsetTop : string|ComponentSpacing|null

##### Return values

$this —

#### setPaddingAll()

BoxComponentBuilder.php : 233

Set paddingAll.

`public setPaddingAll(string|ComponentSpacing|null $paddingAll) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$paddingAll : string|ComponentSpacing|null

##### Return values

$this —

#### setPaddingBottom()

BoxComponentBuilder.php : 269

Set paddingBottom.

`public setPaddingBottom(string|ComponentSpacing|null $paddingBottom) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$paddingBottom : string|ComponentSpacing|null

##### Return values

$this —

#### setPaddingEnd()

BoxComponentBuilder.php : 305

Set paddingEnd.

`public setPaddingEnd(string|ComponentSpacing|null $paddingEnd) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$paddingEnd : string|ComponentSpacing|null

##### Return values

$this —

#### setPaddingStart()

BoxComponentBuilder.php : 287

Set paddingStart.

`public setPaddingStart(string|ComponentSpacing|null $paddingStart) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$paddingStart : string|ComponentSpacing|null

##### Return values

$this —

#### setPaddingTop()

BoxComponentBuilder.php : 251

Set paddingTop.

`public setPaddingTop(string|ComponentSpacing|null $paddingTop) : $this`

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

##### Parameters

$paddingTop : string|ComponentSpacing|null

##### Return values

$this —

#### setPosition()

BoxComponentBuilder.php : 319

Set position.

`public setPosition(string|ComponentPosition|null $position) : $this`

specifiable relative or absolute

##### Parameters

$position : string|ComponentPosition|null

##### Return values

$this —

#### setSpacing()

BoxComponentBuilder.php : 191

Set spacing.

`public setSpacing(ComponentSpacing|string|null $spacing) : $this`

##### Parameters

$spacing : ComponentSpacing|string|null

##### Return values

$this —

#### setWidth()

BoxComponentBuilder.php : 473

Set width

`public setWidth(string|null $width) : $this`

specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px

※In horizontal and baseline box, `flex` property is ignored and the value is regarded as 0

##### Parameters

$width : string|null

##### Return values

$this —

## Search results