Button
Explore colors, variants, sizes, and interaction states.
Live TypeScript example
Try the component here, then use the source below in your application.
Click Save changes to trigger the example callback.
import '@bluui/web/styles.css'
import { createButton } from "@bluui/web";
export function mount(host: HTMLElement) {
const output = document.createElement("p");
output.setAttribute("role", "status");
let clicks = 0;
const button = createButton(
host,
{ Label: "Save changes", Color: "Primary", Variant: "Filled" },
{
Click: () => {
clicks += 1;
output.textContent = `Save callback received (${clicks}). Connect your save request here.`;
},
},
);
host.append(output);
return {
destroy() {
button.destroy();
output.remove();
},
};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://bluui.blutekmedia.com/downloads/bluui-web-0.2.2.tgz<div id="example"></div>This example uses the downloadable @bluui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
This reference documents the published Block’s parameters, events, and types. The web examples adapt those inputs to browser callbacks. Open native showcase ↗
- Web playground
- Needs work
- TypeScript
- Needs work
- OutSystems
- Needs work
Normal buttons have names and disabled states in all three implementations. Enter activates both TypeScript and native callbacks.
Still to address: Several filled color pairs miss normal-text contrast. The native loading example is an unnamed disabled button with no aria-busy; retain its action name and loading state.
Audit evidence and scope →Purpose and use
Use a Button to trigger an action. Give the main action a filled treatment; use outlined and ghost variants for supporting actions.
Keyboard design guidance
Tab moves between enabled buttons. Enter or Space activates a focused button. Disabled and loading buttons cannot be activated.
This describes the intended interaction. The dated audit above identifies verified behavior and current gaps.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.