Use a native button for an immediate action. NeuButton adds signal inputs for tone, visual variant, size, loading and icon placement while retaining native button semantics. Use a link for navigation and a selection control for persistent choices; this component does not own form or selection state.
Use tone for semantic color: neutral, success, info, warning or danger. brand remains available for the primary action. All six tones support solid, outline and ghost variants. size changes the control dimensions. Loading disables activation and announces busy state.
size chooses sm, md or lg control dimensions; it is not a width input. A normal Button fits its content. fullWidth=true makes it occupy the containing surface.
For a fixed or responsive application width, use CSS such as inline-size: min(100%, 240px). There is no width input to bind. iconOnly uses square dimensions based on size; keep that mode separate from a full-width text action.
Choose one of two integration paths: set the icon input to an application key resolved by provideNeuIconResolver, or place an icon component or SVG directly inside the button. Projection needs neither the icon input nor a Core resolver. Neural Icons is one option, not a requirement; Core remains independent of the icon library.
For the icon input, iconPosition selects start or end. For projected content, put the icon before or after the text in the template. The add key also has a minimal Button fallback that works without a resolver; other application keys need a resolver and do not automatically load an icon catalog.
For an icon-only action, use iconOnly with either integration path, omit visible text and provide ariaLabel. iconOnly sets square dimensions; it does not remove projected content. The demo covers these options, and its TypeScript, HTML and provider tabs contain the code that runs them.
Icons
Minimal Core icon
The add key has a fallback drawing in Button and works without a resolver. This does not mean Core includes an icon catalog.
The icon input and application resolver
icon="save" is a key resolved by the application. iconPosition places that icon at the start or end. The provider tab includes the required registration.
An icon component inside the button
Here Neural Icons is projected directly. You can also project your own component or one from another library: no icon input or Core resolver is needed. Content order determines the position.
An inline SVG, without an icon library
The SVG is part of the button content. Use currentColor to inherit its color and aria-hidden="true" when the text already names the action.
Icon only: input or projected content
iconOnly applies square dimensions; it does not remove content. Omit visible text and provide ariaLabel. These three buttons use the input, projected Neural Icons and a projected SVG, respectively.
Change appearance, text, icon, width and interaction state, then copy the component code. The result uses the same values as the generated template. Click the enabled button to see its neuClick event count.
Width choices distinguish the Core fullWidth input from a CSS inline-size. Application icons also show the provider setup they need; Add can use the built-in fallback without that setup.
Result
Generated code
The result and code update as you change the options.
Core handles native keyboard activation, disabled/loading behavior and the busy-state attribute.
Your application supplies a clear action label. For an icon-only button, set ariaLabel. Keep decorative projected icons hidden from assistive technology.
Key
Action
Enter
Activate the focused native button.
Space
Activate the focused native button.
Tab
Move focus to or from an enabled button in document order.
Inputs configure applied state: use [property]="value" for a dynamic value or a literal attribute for a fixed string. Button has ten inputs and no editable value model. Its visible text is projected between the opening and closing button tags; there is no label input.
The neuClick output emits a MouseEvent when an enabled button is activated. Listen with (neuClick)="save($event)". Neither disabled nor loading is managed by that event; your application owns the operation and passes the current state back to Button.
Inputs
Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
Name
Type
Default
Template binding
Description
ariaLabel
string
''
[ariaLabel]
Accessible name override, required for an icon-only action.
disabled
boolean
false
[disabled]
Blocks native activation and neuClick.
fullWidth
boolean
false
[fullWidth]
Sets the button to 100% of its container. For another width, use CSS; there is no width input.
icon
string | null
null
[icon]
Application key (string), not an icon definition or built-in catalog name. Resolve custom keys with provideNeuIconResolver; add has a minimal Button fallback.
iconOnly
boolean
false
[iconOnly]
Uses square dimensions with an input icon or a projected icon. It does not remove projected content: omit visible text and provide an accessible ariaLabel.
Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
Name
Payload
Template binding
Description
neuClick
MouseEvent
(neuClick)="onNeuClick($event)"
Emits MouseEvent for an enabled activation. Listen with (neuClick); disabled or loading suppresses it. Your application handles the action.
Templates
ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
Name
Mechanism
Contract
*
Button content
Content projection
Text and SVG are projected inside the button; no icon provider is required.
<ng-content />
Context used: โ
Usage example
Content between the button tags is projected content. You can supply text, an icon component or an SVG; the Icons section demonstrates these variants. For iconOnly, omit visible text and provide ariaLabel: projected content is not automatically removed.
Customize content
Public Types
Open a type to inspect its definition and interface fields.
NeuButtonIconPosition.d.ts
import type { NeuButtonIconPosition } from '@neural-ui/core/button';
// Public declaration (reference only)
export type NeuButtonIconPosition = 'start' | 'end';
NeuButtonSize.d.ts
import type { NeuButtonSize } from '@neural-ui/core/button';
// Public declaration (reference only)
export type NeuButtonSize = 'sm' | 'md' | 'lg';
NeuButtonTone.d.ts
import type { NeuButtonTone } from '@neural-ui/core/button';
// Public declaration (reference only)
export type NeuButtonTone = 'neutral' | 'brand' | 'success' | 'info' | 'warning' | 'danger';
NeuButtonVariant.d.ts
import type { NeuButtonVariant } from '@neural-ui/core/button';
// Public declaration (reference only)
export type NeuButtonVariant = 'solid' | 'outline' | 'ghost';
Use the public --neu-button-* component tokens below, or a reusable preset from the Themes guide. Scope overrides to the application surface you want to customize.
Theming
Inherited theme
Local override
Specific tokens
Token
Purpose
State / variant
Default / source
Fallback
--neu-button-background
Background of a solid, brand Button.
solid / brand
var(--neu-primary-solid)Component fallback
--neu-primary-solid
--neu-button-background-hover
Hover background of a solid, brand Button.
solid / brand / hover
var(--neu-primary-solid-hover)Component fallback
--neu-primary-solid-hover
--neu-button-border
Border color of a solid, brand Button.
solid / brand
var(--neu-primary-solid)Component fallback
--neu-primary-solid
--neu-button-foreground
Text and inherited icon color of a solid, brand Button.
solid / brand
var(--neu-primary-solid-fg)Component fallback
--neu-primary-solid-fg
Shared tokens used
Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.
Token
Purpose here
Other impact
Default / fallback
--neu-error
Invalid field or danger-action color
Shared by other Core consumers; scope the override.
#dc2626
--neu-error-bg
Background of invalid or danger states
Shared by other Core consumers; scope the override.
#fee2e2
--neu-error-text
Error text and danger outline/ghost Button text in both themes
Shared by other Core consumers; scope the override.
#991b1b
--neu-focus-ring-strong
Emphasized focus treatment
Shared by other Core consumers; scope the override.