Sections
Components
- Alert banner
- Alert dialog
- Alert
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar icon
- Cell layout
- Cell link
- Checkbox
- Collapse
- Control label
- Date picker
- Dialog
- Divider
- Drawer
- Empty cell
- Empty state
- Empty
- Error overlay
- Filter bar
- Filter chips
- Flex
- Grid layout
- Humanised date
- Icon
- Duration input
- Input field
- Input
- Label
- Loader
- More actions
- Number input
- Outside click
- Page loader
- Page
- Popconfirm
- Popover
- Progress pie
- Progress
- Radio button group
- Radio Group
- Radio
- Relative time
- Resizable
- Search input
- Select
- Skeleton text
- Skeleton
- Space
- Squad avatar list
- Status picker
- Stepper
- Switch
- Content switcher
- Table light
- Tabs
- Tag
- Text
- Textarea
- Toast
- Tooltip
- Trigger select
- Upload
<rl-button variant="primary">Button</rl-button>
<rl-button variant="secondary">Button</rl-button>Usage#
Use rl-button after rliSdk.init(). Listen for the native click event that bubbles from the inner button.
tsx
<rl-button variant="primary" onClick={() => console.log("saved")}>
Save
</rl-button>Examples#
Primary#
<rl-button variant="primary">Primary</rl-button>Secondary#
<rl-button variant="secondary">Secondary</rl-button>Ghost#
<rl-button variant="ghost">Ghost</rl-button>Danger#
<rl-button variant="danger">Delete</rl-button>Size#
Use the size attribute.
<rl-button size="small">Small</rl-button>
<rl-button size="medium">Medium</rl-button>
<rl-button size="large">Large</rl-button>Disabled#
<rl-button variant="primary" disabled>Disabled</rl-button>Loading#
<rl-button variant="primary" loading>Saving</rl-button>With click handler#
tsx
<rl-button
variant="primary"
onClick={() => {
// runs when the button is activated
}}
>
Save
</rl-button>API#
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | "ghost" | "link" | "success" | "danger" | "tertiary" | "ai" | … | "secondary" | Visual style. |
size | "small" | "medium" | "large" | "medium" | Control height. |
disabled | boolean | false | Prevents interaction. |
loading | boolean | false | Shows a loading state. |
type | "button" | "submit" | "reset" | "button" | Native button type. |
Events#
| Event | Type | Description |
|---|---|---|
click | MouseEvent | Bubbles from the inner button when activated. Use React onClick on the host, or addEventListener("click", …) in Vanilla JS. |