Buttons represent actions the user can take, such as submitting a form, opening a dialog, or navigating to another page.
Solid
Neutral
Primary
Success
Warning
Danger
Outline
Neutral
Primary
Success
Warning
Danger
Clear
Neutral
Primary
Success
Warning
Danger
<strong>Solid</strong><br />
<orb-button>Neutral</orb-button>
<orb-button color="primary">Primary</orb-button>
<orb-button color="success">Success</orb-button>
<orb-button color="warning">Warning</orb-button>
<orb-button color="danger">Danger</orb-button>
<orb-divider></orb-divider>
<strong>Outline</strong><br />
<orb-button fill="outline">Neutral</orb-button>
<orb-button fill="outline" color="primary">Primary</orb-button>
<orb-button fill="outline" color="success">Success</orb-button>
<orb-button fill="outline" color="warning">Warning</orb-button>
<orb-button fill="outline" color="danger">Danger</orb-button>
<orb-divider></orb-divider>
<strong>Clear</strong><br />
<orb-button fill="clear">Neutral</orb-button>
<orb-button fill="clear" color="primary">Primary</orb-button>
<orb-button fill="clear" color="success">Success</orb-button>
<orb-button fill="clear" color="warning">Warning</orb-button>
<orb-button fill="clear" color="danger">Danger</orb-button>
X-Small
Small
Medium
Large
<orb-button size="xs">X-Small</orb-button>
<orb-button size="sm">Small</orb-button>
<orb-button>Medium</orb-button>
<orb-button size="lg">Large</orb-button>
Default Radius
Pill
<orb-button>Default Radius</orb-button>
<orb-button radius="pill">Pill</orb-button>
<orb-button radius="circle">
<iconify-icon icon="mdi:heart"></iconify-icon>
</orb-button>
Medium
<orb-button color="primary" disabled>Medium</orb-button>
Save
HTML
Javascript
<orb-button id="pending-button" color="primary">Save</orb-button>
const button = document.querySelector('#pending-button');
button.addEventListener('click', () => {
button.pending = true;
setTimeout(() => {
button.pending = false;
}, 2000);
});
Paragraph
HTML
Javascript
<orb-button id="dropdown-button" caret space-between fill="clear">Paragraph</orb-button>
<orb-menu id="dropdown-menu" for="dropdown-button" mode="single">
<orb-mi checked>Paragraph</orb-mi>
<orb-mi>Heading 1</orb-mi>
<orb-mi>Heading 2</orb-mi>
<orb-mi>Heading 3</orb-mi>
<orb-mi>Heading 4</orb-mi>
<orb-mi>Heading 5</orb-mi>
<orb-mi>Heading 6</orb-mi>
</orb-menu>
const menu = document.querySelector('#dropdown-menu');
const button = document.querySelector('#dropdown-button');
menu.addEventListener('orbSelect', (e) => {
button.textContent = e.detail.item.textContent;
});
| Description |
If true, the button will have a caret |
| Attribute |
caret |
| Type |
boolean |
| Default |
false |
| Description |
Predefined colors |
| Attribute |
color |
| Type |
"danger" | "primary" | "success" | "warning" |
| Default |
undefined |
| Description |
Disables button |
| Attribute |
disabled |
| Type |
boolean |
| Default |
false |
| Description |
Expands the button to the full width of it’s container |
| Attribute |
expand |
| Type |
boolean |
| Default |
false |
| Description |
Button fill |
| Attribute |
fill |
| Type |
"clear" | "outline" | "solid" |
| Default |
"solid" |
| Description |
Can set form id to participate in forms. Use this if you need to place submit/reset button outside the form element |
| Attribute |
form |
| Type |
string |
| Default |
undefined |
| Description |
Shows a loading spinner and disables the button |
| Attribute |
pending |
| Type |
boolean |
| Default |
false |
| Description |
Button corners |
| Attribute |
radius |
| Type |
"circle" | "default" | "pill" |
| Default |
"default" |
| Description |
A promise that resolves when the component has completed it’s initial render |
| Attribute |
– |
| Type |
Promise<unknown> |
| Default |
new Promise((res) => (this.#resolve = res)) |
| Description |
Button size |
| Attribute |
size |
| Type |
"lg" | "md" | "sm" | "xs" |
| Default |
"md" |
| Description |
If true, the button’s content will be spaced apart |
| Attribute |
space-between |
| Type |
boolean |
| Default |
false |
| Description |
Can set to submit or reset to participate in forms |
| Attribute |
type |
| Type |
"reset" | "submit" |
| Default |
undefined |
| Description |
Will be used as the value if it has a name and is nested in a form |
| Attribute |
value |
| Type |
File | FormData | string |
| Default |
undefined |
| Slot |
Description |
|
Button content |
"badge" |
Badge content |
| Part |
Description |
"loading" |
The orb-loading element displayed when pending |
| State |
Initial Value |
Description |
:state(pending) |
false |
Whenever the button is pending |
| Name |
Description |
--active-background |
Pressed background color |
--background |
Default background color |
--color |
Text color |
--font-size |
Font size |
--height |
Fixed height |
--hover-background |
Hovered background color |
--padding-inline |
Inner inline padding |
graph TD;
orb-button --> orb-loading
orb-alert --> orb-button
orb-calendar --> orb-button
orb-cell --> orb-button
orb-copy-button --> orb-button
orb-datepicker --> orb-button
orb-file-input --> orb-button
orb-menu --> orb-button
orb-pill --> orb-button
orb-rich-text --> orb-button
orb-tab-button --> orb-button
orb-textbox --> orb-button
orb-view --> orb-button
style orb-button fill:#f9f,stroke:#333,stroke-width:4px