import { KbqEmptyStateModule } from '@koobiq/components/empty-state';

KbqEmptyState

componentСкопировать ссылку на KbqEmptyState

Placeholder rendered in place of content that is empty, unavailable or failed to load. Projects an illustration, a title, a text and an actions row, in that order.

<kbq-empty-state>
    <h2 kbq-empty-state-title>No groups</h2>
    <div kbq-empty-state-text>Agents can be grouped and given the same policies</div>
</kbq-empty-state>

The host has no intrinsic height — it grows as a flex item and is otherwise as tall as its content, which leaves alignTop indistinguishable from the default. Give the host or its container a height for the alignment to mean anything.

For an empty state inserted dynamically, add role="status" — or role="alert" for the error variant — on the host so assistive technology announces it. See the component guide.

@Component({ selector: 'kbq-empty-state', exportAs: 'kbqEmptyState' })
class KbqEmptyState implements KbqEmptyStateContext {
    readonly errorColor = input<boolean>(false);
    readonly alignTop = input<boolean>(false);
    readonly size = input<KbqDefaultSizes>('normal');
}
errorColorinputСкопировать ссылку на errorColorboolean

Whether the title, the text and the projected icon render in the error color. Defaults to false.

alignTopinputСкопировать ссылку на alignTopboolean

Whether the content sits at the top of the host instead of its center. Defaults to false.

sizeinputСкопировать ссылку на sizeKbqDefaultSizes

Size tier of the placeholder: compact, normal or big. Drives every padding and offset, the maximum width of the title and the text, and their typography. Defaults to normal.

KbqEmptyStateActions

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

Actions slot of kbq-empty-state, rendered below the text. Holds buttons, links or pseudo-links.

@Directive({ selector: '[kbq-empty-state-actions]' })
class KbqEmptyStateActions {}

KbqEmptyStateIcon

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

Illustration slot of kbq-empty-state. Holds an icon, an image or any other element.

A kbq-icon-item follows the empty state's errorColor, whether the directive sits on the icon itself or wraps it.

@Directive({ selector: '[kbq-empty-state-icon]' })
class KbqEmptyStateIcon {}

KbqEmptyStateText

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

Text slot of kbq-empty-state, rendered below the title.

@Directive({ selector: '[kbq-empty-state-text]' })
class KbqEmptyStateText {}

KbqEmptyStateTitle

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

Title slot of kbq-empty-state, rendered below the illustration.

It carries heading typography — subheading at size="normal", headline at size="big" — so the host element should be a real heading of the level the surrounding page calls for: <h2 kbq-empty-state-title>.

@Directive({ selector: '[kbq-empty-state-title]' })
class KbqEmptyStateTitle {}

KbqEmptyStateContext

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

The part of kbq-empty-state its projected slots follow.

interface KbqEmptyStateContext {
    readonly errorColor: Signal<boolean>;
}
errorColorСкопировать ссылку на errorColorSignal<boolean>

Whether the empty state renders in the error color.

Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.