Button
Native button component with an opinionated visual structure. The required label owns the accessible name, while optional built-in icons, custom content, and loading indicator slots support limited composition without replacing the button's primary semantics.
Import
import {FktButtonComponent} from "frakton-ng/button";Usage
Native host usage. Apply fktButton directly to a <button> or <a> and provide its required
label. Events, focus, native attributes, directives, element references, and form or navigation
behavior stay on the actual interactive element.
Basic
The appearances use the same native markup and semantic label. type="button" is applied by
default; consumers can use native attributes such as name, value, form, autofocus, and
aria-describedby without forwarding through a wrapper component.
Anchor hosts
Anchor hosts keep native link behavior while sharing the same button appearance and accessibility
contract. type and native disabled are never applied to anchors; disabled or loading anchors
receive aria-disabled, leave the tab order, and block activation.
Sizes
Semantic sizes provide compact, default, and large control densities. Icon-only buttons use fixed square dimensions from the same size scale so toolbar and table actions remain aligned.
Composition
Limited composition keeps the required label under component ownership while exposing built-in icon inputs, custom visual content, and a loading-indicator slot. Visual content is decorative; the required label remains the accessible name.
Icons and content
Use icon, suffixIcon, and iconOnly for common icon buttons. Use [fktButtonContent] when
the visual content is application-specific and should replace the visible label. Add fill
to let the projected content own the full button surface.
Loading
Loading inserts an indicator at the configured side. At loadingPosition="start" it replaces
icon when present; at loadingPosition="end" it replaces suffixIcon when present. It binds
aria-busy="true" and makes the effective disabled state disabled || loading. Project
[fktButtonLoadingIndicator] to replace the built-in spinner.
Appearance
Appearance combines visual treatment, shape, color, and size without changing button semantics. Semantic colors follow the design system, while custom CSS colors compute a contrasting content color.
Text variants
Appearances and semantic colors across the supported shapes.
@for (shape of shapes; track shape.value) {
@for (appearance of shape.appearances; track appearance.value) {
@for (color of appearance.colors; track color.value) {
}
}
{{ shape.title }}
{{ appearance.title }}
}
Icon variants
Icon-only buttons use the same appearance, shape, and color contracts as labeled buttons. Their
required label is exposed through aria-label.
@for (shape of shapes; track shape.value) {
@for (appearance of shape.appearances; track appearance.value) {
@for (color of appearance.colors; track color.value) {
}
}
{{ shape.title }}
{{ appearance.title }}
}
Custom colors
Any CSS color value is supported for application-specific actions. With
labelColor="auto", the component derives black or white from the resolved color; pass
labelColor when the application needs an explicit override.