thegeneralyst/AnopaDocs
Market

Country Flag

Renders the flag emoji for the currently active market's country and updates automatically when the market changes.

What it does

Country Flag renders the flag emoji for the currently active market's country. It reads from the shared market store and automatically updates whenever the active market changes, ensuring the displayed flag always reflects the current selection.

If no market is currently active, the component displays a configurable fallback emoji instead.

How to set it up

Place APCountryFlag next to components such as APMarketSelector or AP_ActiveMarket so users can clearly see which market is active. The component requires no configuration beyond optional styling and fallback customization.

  1. Add AP_CountryFlag to your layout near your market selection UI.
  2. Optionally adjust the font size to control the visual size of the flag emoji.
  3. Optionally set a custom fallback emoji to show when no market is selected.

The component will automatically subscribe to the market store and re-render when the active market changes.

Property Controls

ControlTypeDefaultDescription
FontFont20pxControls the font size used to render the flag emoji, effectively changing the visual size of the flag.
FallbackString🌍Emoji or text shown when no market is currently active in the market store.
Canvas PreviewString🇬🇧Flag emoji shown in the design canvas as a static preview, independent of the runtime market store.