Appearance
@line/bot-sdk / FlexButton
Type Alias: FlexButton
FlexButton =
object&Offset
Defined in: lib/types.ts:1220
This component draws a button.
When the user taps a button, a specified action is performed.
Type Declaration
action
action:
Action
Action performed when this button is tapped.
Specify an action object.
adjustMode?
optionaladjustMode:"shrink-to-fit"
The method by which to adjust the text font size. Specify this value:
shrink-to-fit: Automatically shrink the font size to fit the width of the component. This property takes a "best-effort" approach that may work differently—or not at all!—on some platforms. For more information, see Automatically shrink fonts to fit in the Messaging API documentation.- LINE 10.13.0 or later for iOS and Android
color?
optionalcolor:string
Use a hexadecimal color code.
- Character color when the
styleproperty islink. - Background color when the
styleproperty isprimaryorsecondary.
flex?
optionalflex:number
The ratio of the width or height of this box within the parent box.
The default value for the horizontal parent box is 1, and the default value for the vertical parent box is 0.
For more information, see Width and height of components.
gravity?
optionalgravity:"top"|"bottom"|"center"
Vertical alignment style. Specify one of the following values:
top: Top-alignedbottom: Bottom-alignedcenter: Center-aligned
The default value is top.
If the layout property of the parent box is baseline, the gravity property will be ignored.
height?
optionalheight:"sm"|"md"
Height of the button. The default value is md.
margin?
optionalmargin:string|"none"|"xs"|"sm"|"md"|"lg"|"xl"|"xxl"
Minimum space between this box and the previous component in the parent box.
nonedoes not set a space while the other values set a space whose size increases in the order of listing.- The default value is the value of the
spacingproperty of the parent box. - If this box is the first component in the parent box, the
marginproperty will be ignored.
style?
optionalstyle:"link"|"primary"|"secondary"
Style of the button. Specify one of the following values:
link: HTML link styleprimary: Style for dark color buttonssecondary: Style for light color buttons
The default value is link.
type
type:
"button"