import { KbqNavbarModule } from '@koobiq/components/navbar';

KbqNavbar

componentСкопировать ссылку на KbqNavbar
@Component({ selector: 'kbq-navbar' })
class KbqNavbar extends KbqFocusableComponent {
    readonly ariaLabel = input<string | null>(null, {
        alias: 'aria-label'
    });
    readonly localeConfiguration: Signal<KbqNavbarLocaleConfiguration>;
}
localeOverridesinputСкопировать ссылку на localeOverridesKbqPartialLocaleData | undefined

Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.

aria-labelinputСкопировать ссылку на 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.

localeConfigurationСкопировать ссылку на localeConfigurationSignal<KbqNavbarLocaleConfiguration>

Localized strings of the navbar, the accessible name of the «More» trigger among them, see KbqNavbarLocaleConfiguration.

KbqNavbarBrand

componentСкопировать ссылку на KbqNavbarBrand
@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;
}
collapsedTextinputСкопировать ссылку на collapsedTextstring

text that will be displayed in the tooltip. By default, the text is taken from kbq-navbar-title.

kbqTooltipDisabledinputСкопировать ссылку на 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-labelinputСкопировать ссылку на aria-labelstring | null

Accessible name of the brand. Needed when the brand renders nothing but a logo.

KbqNavbarItem

componentСкопировать ссылку на KbqNavbarItem
@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;
}
collapsedTextinputСкопировать ссылку на 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.

collapsableinputСкопировать ссылку на collapsableboolean

Whether the item may be collapsed when the horizontal navbar runs out of room.

kbqTooltipDisabledinputСкопировать ссылку на 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-labelinputСкопировать ссылку на 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.

isCollapsedСкопировать ссылку на isCollapsedSignal<boolean>

Whether the item is rendered in its collapsed (icon-only) form.

collapsedСкопировать ссылку на 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.

titleTextСкопировать ссылку на titleTextstring | null

Text used for the tooltip and for the accessible name of a collapsed item.

KbqNavbarToggle

componentСкопировать ссылку на KbqNavbarToggle
@Component({ selector: 'kbq-navbar-toggle, [kbq-navbar-toggle]' })
class KbqNavbarToggle {
    toggle(): void;
}
toggle()Скопировать ссылку на toggle()void

toggles the state of the navbar

KbqVerticalNavbar

componentСкопировать ссылку на KbqVerticalNavbar
@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;
}
openOverinputСкопировать ссылку на openOverboolean

Whether the expanded navbar overlays the page content instead of taking room from it.

expandedmodelСкопировать ссылку на expandedboolean

Whether the navbar is expanded.

localeOverridesinputСкопировать ссылку на localeOverridesKbqPartialLocaleData | undefined

Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.

aria-labelinputСкопировать ссылку на 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.

localeConfigurationСкопировать ссылку на 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()Скопировать ссылку на toggle()void

Expands a collapsed navbar and collapses an expanded one.

KbqFocusableComponent

directiveСкопировать ссылку на KbqFocusableComponent
@Directive()
class KbqFocusableComponent {
    readonly ariaLabel = input<string | null>(null, {
        alias: 'aria-label'
    });
}
aria-labelinputСкопировать ссылку на 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.

KbqNavbarBento

directiveСкопировать ссылку на KbqNavbarBento
@Directive({ selector: 'kbq-navbar-item[bento], [kbq-navbar-item][bento]' })
class KbqNavbarBento {}

KbqNavbarContainer

directiveСкопировать ссылку на KbqNavbarContainer
@Directive({ selector: 'kbq-navbar-container, [kbq-navbar-container]' })
class KbqNavbarContainer {}

KbqNavbarDivider

directiveСкопировать ссылку на KbqNavbarDivider
@Directive({ selector: 'kbq-navbar-divider' })
class KbqNavbarDivider {}

KbqNavbarFocusableItem

directiveСкопировать ссылку на KbqNavbarFocusableItem
@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);
}
disabledinputСкопировать ссылку на 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.

nestedElementСкопировать ссылку на nestedElementKbqNavbarNestedElement | undefined

Interactive element projected into the item, if any.

KbqNavbarItemContent

directiveСкопировать ссылку на KbqNavbarItemContent

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 {}

KbqNavbarItemSuffix

directiveСкопировать ссылку на KbqNavbarItemSuffix

Marks content to be projected after the title of a navbar item.

@Directive({ selector: '[kbqNavbarItemSuffix]' })
class KbqNavbarItemSuffix {}
directiveСкопировать ссылку на KbqNavbarLogo
@Directive({ selector: 'kbq-navbar-logo, [kbq-navbar-logo]' })
class KbqNavbarLogo {}

KbqNavbarRectangleElement

directiveСкопировать ссылку на KbqNavbarRectangleElement
@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;
}
alwaysVisibleinputСкопировать ссылку на alwaysVisibleboolean

Element with this attribute is never hidden under the «More» panel of a horizontal navbar, whatever the overflow. Defaults to false.

orientationСкопировать ссылку на orientationKbqNavbarOrientation

Orientation of the navbar this element belongs to. Written by the ambient KbqNavbar / KbqVerticalNavbar; the element itself only reads it.

getOuterElementWidth()Скопировать ссылку на getOuterElementWidth()number

Outer width of the element: its border box plus horizontal margins.

KbqNavbarTitle

directiveСкопировать ссылку на KbqNavbarTitle
@Directive({ selector: 'kbq-navbar-title, [kbq-navbar-title]' })
class KbqNavbarTitle {
    get text(): string;
    get isOverflown(): boolean;
    get isClamped(): boolean;
    getOuterElementWidth(): number;
}
textСкопировать ссылку на textstring

Text content of the title element.

isOverflownСкопировать ссылку на isOverflownboolean

Whether the text is clipped horizontally (e.g. by text-overflow: ellipsis).

isClampedСкопировать ссылку на 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()Скопировать ссылку на getOuterElementWidth()number

Outer width of the title: its border box plus horizontal margins.

KbqNavbarItemTrigger

interfaceСкопировать ссылку на KbqNavbarItemTrigger

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;
}
hasFocusСкопировать ссылку на hasFocusboolean

Whether the component currently holds focus.

focus()Скопировать ссылку на focus()void

Moves focus into the component.

focusViaKeyboard()optionalСкопировать ссылку на focusViaKeyboard()void

Moves focus into the component as if it was reached with the keyboard — the focused element shows its keyboard focus state.

KbqNavbarNestedElement

typeСкопировать ссылку на KbqNavbarNestedElement

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;

KbqNavbarOrientation

typeСкопировать ссылку на KbqNavbarOrientation

Orientation of the navbar an element belongs to.

type KbqNavbarOrientation = 'horizontal' | 'vertical';

KBQ_NAVBAR_ITEM_TRIGGER

constСкопировать ссылку на KBQ_NAVBAR_ITEM_TRIGGER

Makes a custom component projected into a navbar item the owner of the item's interaction.

const KBQ_NAVBAR_ITEM_TRIGGER: InjectionToken<KbqNavbarItemTrigger>;

KBQ_VERTICAL_NAVBAR_CONFIGURATION

constDeprecatedСкопировать ссылку на KBQ_VERTICAL_NAVBAR_CONFIGURATION

Use KBQ_NAVBAR_LOCALE_CONFIGURATION. Will be removed in 22.0.0.

const KBQ_VERTICAL_NAVBAR_CONFIGURATION: InjectionToken<KbqNavbarLocaleConfiguration>;

KBQ_VERTICAL_NAVBAR_DEFAULT_CONFIGURATION

constDeprecatedСкопировать ссылку на KBQ_VERTICAL_NAVBAR_DEFAULT_CONFIGURATION

Use KBQ_NAVBAR_DEFAULT_LOCALE_CONFIGURATION. Will be removed in 22.0.0.

const KBQ_VERTICAL_NAVBAR_DEFAULT_CONFIGURATION: KbqNavbarLocaleConfiguration;

kbqNavbarLocaleConfigurationProvider

constСкопировать ссылку на kbqNavbarLocaleConfigurationProvider

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;
Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.