A Base UI (Angular) button is a Tailwind-styled directive you copy in with npx base-ui-cli add button. Put base-button on a native button, then set color and size. There is no runtime package — the source lives in your repo, so you can restyle it or swap in base-progress-button for a loading state.
Install with npx base-ui-cli add button.
Playground
<button base-button color="primary" size="default" [disabled]="false">Button</button>
Add base-button to the <button>. Default button example below.
Use color="" attribute to define button color. Supported colors are "primary", "success", "danger", "warning", "accent", "white" and "black"
Use disabled to disable button.
Loading lives on base-progress-button, not base-button. The label fades while a spinner keeps the width stable. Pair with disabled when the action cannot be retried.
Add preferred icon in front or back of the content of the button.
Add a <base-badge> with the preferred content and color, inside the <button> tag. As well the badge can be positioned in the any of the corners of the button with Tailwindcss classes.
Use modifier base-button-stroked and color="" attribute to define button color. Supported colors are "primary", "success", "danger", "warning", "accent", "white" and "black"
Use attribute size="" to define the size of the button. Supported sizes are "sm", "lg", "xl", "xxl", if size="" is not given, the button will be rendered with its default size.
Add base-icon-button to the <button> tag and the preferred icon from our Icon Pack. And use color="" attribute to define button color. Supported colors are "primary", "success", "danger", "warning", "accent", "white", "black" and "transparent"
Add base-icon-stroked-button to the <button> tag and the preferred icon from our Icon Pack. And use color="" attribute to define button color. Supported colors are "primary", "success", "danger", "warning", "accent", "white", "black" and "transparent"
Use attribute size="" to define the size of the button. Supported sizes are "sm", "lg", "xl", "xxl", if size="" is not given, the button will be rendered with its default size.
Site-wide VPAT-style notes live on the accessibility report.
Run the following command to add this component to your project:
npx base-ui-cli add button
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add button
// Paths are relative to aliases.components (default: src/app/components)
import { BaseButtonDirective } from './button/base-button.directive';
import { IconButtonDirective } from './button/base-icon-button.directive';
import { IconStrokedButtonDirective } from './button/base-icon-stroked-button.directive';
import { BaseLinkDirective } from './button/base-link.directive';
import { StrokedButtonDirective } from './button/base-stroked-button.directive';
@Component({
selector: 'app-your-component',
imports: [
BaseButtonDirective,
BaseLinkDirective,
IconButtonDirective,
IconStrokedButtonDirective,
StrokedButtonDirective
],
template: `...`
})
export class YourComponent {} API for button — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
[base-button] | color | ButtonColor | 'default' | The semantic visual color. Defaults to 'default'. |
[base-button] | size | ButtonSize | 'default' | The size of the button. Defaults to 'default'. |
[base-button] | width | string | — | Optional custom width (e.g. '100%'). |
[base-icon-button] | color | IconButtonColor | 'default' | The semantic visual color. Defaults to 'default'. |
[base-icon-button] | size | IconButtonSize | 'default' | The size of the button. Defaults to 'default'. |
[base-link] | color | LinkColor | 'default' | The semantic visual color. Defaults to 'default'. |
[base-link] | size | LinkSize | 'default' | The size of the link. Defaults to 'default'. |
[base-link] | width | string | — | Optional custom width (e.g. '100%'). |
[base-stroked-button] | color | StrokedButtonColor | 'default' | The semantic visual color. Defaults to 'default'. |
[base-stroked-button] | size | StrokedButtonSize | 'default' | The size of the button. Defaults to 'default'. |
[base-stroked-button] | width | string | — | Optional custom width (e.g. '100%'). |
[base-stroked-icon-button] | color | IconStrokedButtonColor | 'default' | The semantic visual color. Defaults to 'default'. |
[base-stroked-icon-button] | size | IconStrokedButtonSize | 'default' | The size of the button. Defaults to 'default'. |
Page Content