Menu

## ButtonComponentBuilder
in package
implements ComponentBuilder

ButtonComponentBuilder.php : 38

A builder class for button component.

### Interfaces, Classes and Traits

ComponentBuilder
  The interface that has a responsibility to build component.

### Table of Contents

$actionBuilder : TemplateActionBuilder
$adjustMode : ComponentAdjustMode
$color : string
$component : array<string|int, mixed>|null
$flex : int
$gravity : ComponentGravity
$height : ComponentButtonHeight
$margin : ComponentMargin
$offsetBottom : string
$offsetEnd : string
$offsetStart : string
$offsetTop : string
$position : string
$style : ComponentButtonStyle
__construct() : mixed
  ButtonComponentBuilder constructor.
build() : array<string|int, mixed>
  Builds button component structure.
builder() : ButtonComponentBuilder
  Create empty ButtonComponentBuilder.
setAction() : ButtonComponentBuilder
  Set action.
setAdjustMode() : $this
  Set adjustMode
setColor() : ButtonComponentBuilder
  Set color.
setFlex() : ButtonComponentBuilder
  Set flex.
setGravity() : ButtonComponentBuilder
  Set gravity.
setHeight() : ButtonComponentBuilder
  Set height.
setMargin() : ButtonComponentBuilder
  Set margin.
setOffsetBottom() : $this
  Set offsetBottom.
setOffsetEnd() : $this
  Set offsetEnd.
setOffsetStart() : $this
  Set offsetStart.
setOffsetTop() : $this
  Set offsetTop.
setPosition() : $this
  Set position.
setStyle() : ButtonComponentBuilder
  Set style.

### Properties

#### $actionBuilder

ButtonComponentBuilder.php : 41
`private TemplateActionBuilder $actionBuilder`

#### $adjustMode

ButtonComponentBuilder.php : 67
`private ComponentAdjustMode $adjustMode`

#### $color

ButtonComponentBuilder.php : 51
`private string $color`

#### $component

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

#### $flex

ButtonComponentBuilder.php : 43
`private int $flex`

#### $gravity

ButtonComponentBuilder.php : 53
`private ComponentGravity $gravity`

#### $height

ButtonComponentBuilder.php : 47
`private ComponentButtonHeight $height`

#### $margin

ButtonComponentBuilder.php : 45
`private ComponentMargin $margin`

#### $offsetBottom

ButtonComponentBuilder.php : 60
`private string $offsetBottom`

#### $offsetEnd

ButtonComponentBuilder.php : 64
`private string $offsetEnd`

#### $offsetStart

ButtonComponentBuilder.php : 62
`private string $offsetStart`

#### $offsetTop

ButtonComponentBuilder.php : 58
`private string $offsetTop`

#### $position

ButtonComponentBuilder.php : 56
`private string $position`

#### $style

ButtonComponentBuilder.php : 49
`private ComponentButtonStyle $style`

### Methods

#### __construct()

ButtonComponentBuilder.php : 83

ButtonComponentBuilder constructor.

`public __construct(TemplateActionBuilder|null $actionBuilder[, int|null $flex = null ][, ComponentMargin|null $margin = null ][, ComponentButtonHeight|null $height = null ][, ComponentButtonStyle|null $style = null ][, string|null $color = null ][, ComponentGravity|null $gravity = null ]) : mixed`

##### Parameters

$actionBuilder : TemplateActionBuilder|null
$flex : int|null = null
$margin : ComponentMargin|null = null
$height : ComponentButtonHeight|null = null
$style : ComponentButtonStyle|null = null
$color : string|null = null
$gravity : ComponentGravity|null = null

##### Return values

mixed —

#### build()

ButtonComponentBuilder.php : 298

Builds button component structure.

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

##### Return values

array<string|int, mixed> —

#### builder()

ButtonComponentBuilder.php : 106

Create empty ButtonComponentBuilder.

`public static builder() : ButtonComponentBuilder`

##### Return values

ButtonComponentBuilder —

#### setAction()

ButtonComponentBuilder.php : 117

Set action.

`public setAction(TemplateActionBuilder $actionBuilder) : ButtonComponentBuilder`

##### Parameters

$actionBuilder : TemplateActionBuilder

##### Return values

ButtonComponentBuilder —

#### setAdjustMode()

ButtonComponentBuilder.php : 287

Set adjustMode

`public setAdjustMode(ComponentAdjustMode|null $adjustMode) : $this`

##### Parameters

$adjustMode : ComponentAdjustMode|null

##### Return values

$this —

#### setColor()

ButtonComponentBuilder.php : 177

Set color.

`public setColor(string|null $color) : ButtonComponentBuilder`

##### Parameters

$color : string|null

##### Return values

ButtonComponentBuilder —

#### setFlex()

ButtonComponentBuilder.php : 129

Set flex.

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

##### Parameters

$flex : int|null

##### Return values

ButtonComponentBuilder —

#### setGravity()

ButtonComponentBuilder.php : 189

Set gravity.

`public setGravity(ComponentGravity|string|null $gravity) : ButtonComponentBuilder`

##### Parameters

$gravity : ComponentGravity|string|null

##### Return values

ButtonComponentBuilder —

#### setHeight()

ButtonComponentBuilder.php : 153

Set height.

`public setHeight(ComponentButtonHeight|string|null $height) : ButtonComponentBuilder`

##### Parameters

$height : ComponentButtonHeight|string|null

##### Return values

ButtonComponentBuilder —

#### setMargin()

ButtonComponentBuilder.php : 141

Set margin.

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

##### Parameters

$margin : ComponentMargin|string|null

##### Return values

ButtonComponentBuilder —

#### setOffsetBottom()

ButtonComponentBuilder.php : 239

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

ButtonComponentBuilder.php : 275

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

ButtonComponentBuilder.php : 257

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

ButtonComponentBuilder.php : 221

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 —

#### setPosition()

ButtonComponentBuilder.php : 203

Set position.

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

specifiable relative or absolute

##### Parameters

$position : string|ComponentPosition|null

##### Return values

$this —

#### setStyle()

ButtonComponentBuilder.php : 165

Set style.

`public setStyle(ComponentButtonStyle|string|null $style) : ButtonComponentBuilder`

##### Parameters

$style : ComponentButtonStyle|string|null

##### Return values

ButtonComponentBuilder —

## Search results