Button
A Button signifies an operation (or a series of operations). Clicking it triggers the corresponding logic.
Example
API Methods
setButtonHeight
Sets the height of the button
- Method
- Usage
setButtonHeight(buttonHeight: string): void
// Sets the button height to Large
a8forms.Button("buttonId").setButtonHeight("Large");
// Sets the button height to Medium
a8forms.Button("buttonId").setButtonHeight("Medium");
// Sets the button height to Small
a8forms.Button("buttonId").setButtonHeight("Small");
setButtonType
Sets the type of the button
- Method
- Usage
setButtonType(buttonType: string): void
// Sets the button type to Primary
a8forms.Button("buttonId").setButtonType("primary");
// Sets the button type to Ghost
a8forms.Button("buttonId").setButtonType("ghost");
// Sets the button type to Dashed
a8forms.Button("buttonId").setButtonType("dashed");
// Sets the button type to Link
a8forms.Button("buttonId").setButtonType("link");
// Sets the button type to Text
a8forms.Button("buttonId").setButtonType("text");
// Sets the button type to Default
a8forms.Button("buttonId").setButtonType("default");
setDisabled
Sets the button state using the boolean value
- Method
- Usage
setDisabled(disabled: boolean): void
// Disables the button when set to true
a8forms.Button("buttonId").setDisabled(true);
// Enables the button when set to false
a8forms.Button("buttonId").setDisabled(false);
setLabel
Sets a label to the Button
- Method
- Usage
setLabel(label: string): void
// Sets the label of the button as Click
a8forms.Button("buttonId").setLabel("Click");
setSize
Sets the size only using the parameters passed in.
- Method
- Usage
setSize(size: "small" | "medium" | "large"): void
//Sets the size to small
a8forms.Button("buttonId").setSize("small");
//Sets the size to medium
a8forms.Button("buttonId").setSize("medium");
//Sets the size to large
a8forms.Button("buttonId").setSize("large");
setVisibility
Sets if elements of the given category is visible in this view.
- Method
- Usage
setVisibility(visible: boolean): void
// setting the visibility true makes the Button to be visible
a8forms.Button("buttonId").setVisibility(true);
// setting the visibility false makes the Button invisible
a8forms.Button("buttonId").setVisibility(false);
setVisibilityCondition
Sets the hide condition
- Method
- Usage
setVisibilityCondition(condition: string): void
// Hides the string
a8forms.Button("buttonId").setVisibilityCondition("1 == 1");