import { KbqNavbarModule } from '@koobiq/components/navbar';@Component({ selector: 'kbq-navbar' })
class KbqNavbar extends KbqFocusableComponent {
readonly ariaLabel = input<string | null>(null, {
alias: 'aria-label'
});
readonly localeConfiguration: Signal<KbqNavbarLocaleConfiguration>;
}localeOverridesKbqPartialLocaleData | undefined Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.
aria-labelstring | null Accessible name of the navigation landmark. Set it whenever a page renders more than one navbar, so assistive technology can tell them apart.
localeConfigurationSignal<KbqNavbarLocaleConfiguration> Localized strings of the navbar, the accessible name of the «More» trigger among them, see
KbqNavbarLocaleConfiguration.
@Component({
selector: 'kbq-navbar-brand, [kbq-navbar-brand]',
exportAs: 'kbqNavbarBrand'
})
class KbqNavbarBrand {
readonly collapsedText = input<string>('');
readonly tooltipDisabled = input<boolean | undefined>(undefined, {
alias: 'kbqTooltipDisabled'
});
readonly ariaLabel = input<string | null>(null, {
alias: 'aria-label'
});
get isLink(): boolean;
}collapsedTextstring text that will be displayed in the tooltip. By default, the text is taken from kbq-navbar-title.
kbqTooltipDisabledboolean | undefined Explicitly enables or disables the brand's tooltip.
Left unset, the tooltip is enabled exactly when the title cannot be read from the brand itself — the navbar is collapsed, the title is clipped, or there is no title at all.
aria-labelstring | null Accessible name of the brand. Needed when the brand renders nothing but a logo.
isLinkboolean Whether the brand is rendered as a native link.
@Component({
selector: 'kbq-navbar-item, [kbq-navbar-item]',
exportAs: 'kbqNavbarItem'
})
class KbqNavbarItem {
readonly collapsedText = input<string>('');
readonly collapsable = input<boolean>(true);
readonly tooltipDisabled = input<boolean | undefined>(undefined, {
alias: 'kbqTooltipDisabled'
});
readonly ariaLabel = input<string | null>(null, {
alias: 'aria-label'
});
readonly isCollapsed: Signal<boolean>;
set collapsed(value: boolean);
get titleText(): string | null;
}collapsedTextstring Text shown in the tooltip of a collapsed item, and in the row an icon-only item renders in the «More» panel
(where it wins over aria-label and the tooltip text). Defaults to the text of the projected
kbq-navbar-title.
collapsableboolean Whether the item may be collapsed when the horizontal navbar runs out of room.
kbqTooltipDisabledboolean | undefined Explicitly enables or disables the item's tooltip.
Left unset, the tooltip is enabled exactly when the title cannot be read from the item itself — the item is collapsed, its title is clipped, or it has no title at all.
aria-labelstring | null Accessible name of the item. Needed for an icon-only item, which has no visible label of its own; an item that renders a title is named by it.
isCollapsedSignal<boolean> Whether the item is rendered in its collapsed (icon-only) form.
collapsedboolean Collapses the item regardless of what the ambient navbar decided. The class is written here rather than only through the host binding: the navbar's fit measures the layout in the same pass it collapses items in, and a binding reaches the DOM only at the next change detection.
titleTextstring | null Text used for the tooltip and for the accessible name of a collapsed item.
@Component({ selector: 'kbq-navbar-toggle, [kbq-navbar-toggle]' })
class KbqNavbarToggle {
toggle(): void;
}toggle()void toggles the state of the navbar
@Component({ selector: 'kbq-vertical-navbar', exportAs: 'KbqVerticalNavbar' })
class KbqVerticalNavbar extends KbqFocusableComponent {
readonly openOver = input<boolean>(false);
readonly expanded = model<boolean>(false);
readonly ariaLabel = input<string | null>(null, {
alias: 'aria-label'
});
readonly localeConfiguration: Signal<KbqNavbarLocaleConfiguration>;
toggle(): void;
}openOverboolean Whether the expanded navbar overlays the page content instead of taking room from it.
expandedboolean Whether the navbar is expanded.
localeOverridesKbqPartialLocaleData | undefined Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.
aria-labelstring | null Accessible name of the navigation landmark. Set it whenever a page renders more than one navbar, so assistive technology can tell them apart.
localeConfigurationSignal<KbqNavbarLocaleConfiguration> Localized strings of the navbar.
A signal, so that a locale change reaches the OnPush descendants that render these strings — a plain
field would leave them showing the previous locale until something else marked them dirty. It also keeps
the value observable from outside: KbqNavbarToggle reads it in an effect to refresh its tooltip,
which a markForCheck() here could never have reached in that separate OnPush view.
toggle()void Expands a collapsed navbar and collapses an expanded one.
@Directive()
class KbqFocusableComponent {
readonly ariaLabel = input<string | null>(null, {
alias: 'aria-label'
});
}aria-labelstring | null Accessible name of the navigation landmark. Set it whenever a page renders more than one navbar, so assistive technology can tell them apart.
@Directive({ selector: 'kbq-navbar-item[bento], [kbq-navbar-item][bento]' })
class KbqNavbarBento {}@Directive({ selector: 'kbq-navbar-container, [kbq-navbar-container]' })
class KbqNavbarContainer {}@Directive({ selector: 'kbq-navbar-divider' })
class KbqNavbarDivider {}@Directive({
selector: 'kbq-navbar-item, [kbq-navbar-item], kbq-navbar-brand, [kbq-navbar-brand], kbq-navbar-toggle'
})
class KbqNavbarFocusableItem implements IFocusableOption {
disabled = input<boolean | undefined>();
get nestedElement(): KbqNavbarNestedElement | undefined;
set hasFocus(value: boolean);
}disabledboolean | undefined Whether the item is disabled. Also true for a decorative element and for one hidden under the «More» panel
of a horizontal navbar, which the key manager skips as well.
nestedElementKbqNavbarNestedElement | undefined Interactive element projected into the item, if any.
Marks arbitrary content of a navbar item that takes the spot of the item icon.
The navbar reserves a 40×40px square for the content and leaves the positioning inside the square to the
content itself: it can fill the whole square or render smaller with its own paddings. The square size is
controlled by the --kbq-navbar-item-size-custom-content-width and --kbq-navbar-item-size-custom-content-height
tokens.
@Directive({ selector: '[kbqNavbarItemContent]' })
class KbqNavbarItemContent {}Marks content to be projected after the title of a navbar item.
@Directive({ selector: '[kbqNavbarItemSuffix]' })
class KbqNavbarItemSuffix {}@Directive({ selector: 'kbq-navbar-logo, [kbq-navbar-logo]' })
class KbqNavbarLogo {}@Directive({
selector: 'kbq-navbar-item, [kbq-navbar-item], kbq-navbar-divider, kbq-navbar-brand, [kbq-navbar-brand]'
})
class KbqNavbarRectangleElement implements KbqOverflowFitItem {
readonly alwaysVisible = input<boolean>(false);
orientation: KbqNavbarOrientation;
set collapsed(value: boolean);
getOuterElementWidth(): number;
}alwaysVisibleboolean Element with this attribute is never hidden under the «More» panel of a horizontal navbar, whatever the
overflow. Defaults to false.
orientationKbqNavbarOrientation Orientation of the navbar this element belongs to. Written by the ambient KbqNavbar /
KbqVerticalNavbar; the element itself only reads it.
getOuterElementWidth()number Outer width of the element: its border box plus horizontal margins.
@Directive({ selector: 'kbq-navbar-title, [kbq-navbar-title]' })
class KbqNavbarTitle {
get text(): string;
get isOverflown(): boolean;
get isClamped(): boolean;
getOuterElementWidth(): number;
}textstring Text content of the title element.
isOverflownboolean Whether the text is clipped horizontally (e.g. by text-overflow: ellipsis).
isClampedboolean Whether the text is clipped vertically (e.g. by -webkit-line-clamp).
Kept separate from isOverflown on purpose: wrapped text never exceeds its width, so only this
check catches a clamped title. isOverflown is also read by KbqNavbarItem, whose titles are
always nowrap — folding the two together would let sub-pixel line-height rounding enable
tooltips on every navbar item.
getOuterElementWidth()number Outer width of the title: its border box plus horizontal margins.
A custom interactive component projected into a navbar item in place of a button or a form field.
Provide the component's own class as KBQ_NAVBAR_ITEM_TRIGGER, and the item hands keyboard focus and
activation to it: it gets no synthetic click, stays the single tab stop of the navbar, and keeps working
with arrow-key navigation. The component owns its overlay — a dropdown, a popover, or anything else — and
must not be reachable by Tab on its own (tabindex stays with the navbar, which moves focus between items
with the arrow keys).
The item paints its hover, pressed, selected and keyboard-focus states around the component, so the component styles only its content and must not add a focus outline of its own.
interface KbqNavbarItemTrigger {
readonly hasFocus: boolean;
focus(): void;
focusViaKeyboard?(): void;
}hasFocusboolean Whether the component currently holds focus.
focus()void Moves focus into the component.
focusViaKeyboard()void Moves focus into the component as if it was reached with the keyboard — the focused element shows its keyboard focus state.
Interactive content a navbar item recognizes as owning the interaction: a projected button or form field,
or a custom component provided as KBQ_NAVBAR_ITEM_TRIGGER.
type KbqNavbarNestedElement = KbqButton | KbqFormField | KbqNavbarItemTrigger;Orientation of the navbar an element belongs to.
type KbqNavbarOrientation = 'horizontal' | 'vertical';Makes a custom component projected into a navbar item the owner of the item's interaction.
const KBQ_NAVBAR_ITEM_TRIGGER: InjectionToken<KbqNavbarItemTrigger>;Use KBQ_NAVBAR_LOCALE_CONFIGURATION. Will be removed in 22.0.0.
const KBQ_VERTICAL_NAVBAR_CONFIGURATION: InjectionToken<KbqNavbarLocaleConfiguration>;Use KBQ_NAVBAR_DEFAULT_LOCALE_CONFIGURATION. Will be removed in 22.0.0.
const KBQ_VERTICAL_NAVBAR_DEFAULT_CONFIGURATION: KbqNavbarLocaleConfiguration;Utility provider for KBQ_NAVBAR_LOCALE_CONFIGURATION. Only the strings you pass are overridden; the
rest keep following the active locale.
const kbqNavbarLocaleConfigurationProvider: (
configuration: KbqDeepPartial<KbqNavbarLocaleConfiguration>
) => Provider;