import { KbqFlagModule } from '@koobiq/components/flag';Presentational wrapper for a consumer-provided country flag (inline <svg> or <img>).
Decorates it with shape and shadow and applies the accessibility contract.
The flag is either projected, or passed as markup through the svg input. Do not bind
[innerHTML] on the host element — that write replaces whatever was projected into it.
<kbq-flag decorative><img src="…/AL.svg" alt="" /></kbq-flag> Albania@Component({ selector: 'kbq-flag', exportAs: 'kbqFlag' })
class KbqFlag {
readonly shape = input<KbqFlagShape>('rectangle');
readonly aspectRatio = input<string>();
readonly shadow = input<KbqFlagShadow>('inset');
readonly empty = input<boolean>(false);
readonly svg = input<SafeHtml | string>();
readonly decorative = input<boolean>(false);
readonly label = input<string>();
}shapeKbqFlagShape Shape of the flag. The flag is cropped to it, so square/circle are best fed a 1:1 source —
a center crop of a rectangular flag can cut off meaningful elements. Defaults to 'rectangle'.
aspectRatiostring Proportions of the flag box, as a CSS aspect-ratio value (4 / 3, 1.5). Set it for a source
whose proportions differ from the shape — the flag is cropped to the box either way.
It overrides the ratio the shape implies, so shape="square" with an aspectRatio is no longer
square. Left unset, the ratio comes from the --kbq-flag-aspect-ratio token, which a plain class
rule can still redefine for a whole group of flags at once.
shadowKbqFlagShadow Inset hairline that keeps the flag distinct from the background. Its color adapts to the theme.
Defaults to 'inset'.
emptyboolean Renders a neutral placeholder — use when no flag can be shown (unknown / invalid country code).
svgSafeHtml | string Flag markup rendered into a slot of its own, for flags that come from a package as a string.
A plain string is sanitized, and Angular's sanitizer drops <svg> — pass an SVG through
DomSanitizer.bypassSecurityTrustHtml, and only for markup known at build time.
decorativeboolean Marks the flag as decorative — hidden from screen readers (use when adjacent text is present).
labelstring Accessible name for the flag. Use when the flag carries meaning and has no adjacent text.
Without it the flag is hidden from screen readers, so a flag whose only name comes from the
projected image (alt, <title>) has to repeat it here.
Inset shadow (hairline) that separates the flag from the background.
type KbqFlagShadow = 'inset' | 'none';Shape of the flag. rectangle keeps the default 3:2 ratio, square/circle expect a 1:1 source.
type KbqFlagShape = 'rectangle' | 'square' | 'circle';