Button
Requires:
@ray-js/ray≥0.5.10
Description
Cross-platform basic Button component for actions requiring strong user interaction.
Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
size | "default" | "mini" | No | default | Button size |
type | "default" | "primary" | "warn" | No | default | Button style type |
plain | boolean | No | false | Whether the button is plain (transparent background) |
disabled | boolean | No | false | Whether disabled |
loading | boolean | No | false | Whether to display a loading icon before the label |
formType | "submit" | "reset" | No | - | Used with the form component; clicking will trigger the form component’s submit/reset events |
hoverStartTime | number | No | 20 | How long to press before the pressed state appears, in milliseconds |
hoverStayTime | number | No | 70 | Duration the pressed state remains after the finger is released, in milliseconds |
Valid Values
size
| Value | Description | Since |
|---|---|---|
default | Default size | - |
mini | Small size | - |
type
| Value | Description | Since |
|---|---|---|
default | Default button | - |
primary | Primary action button | - |
warn | Warning action button | - |
formType
| Value | Description | Since |
|---|---|---|
submit | Submit the form and trigger the Form onSubmit callback | - |
reset | Reset the form and trigger the Form onReset callback | - |