GeoList
Top countries with a flag, the localised country name, a bar, share and change. Built on BreakdownTable.
Code
import { GeoList } from "@fadymondy/nasaq/web";export function Audience() { return ( <GeoList valueLabel="Users" rows={[ { code: "SA", value: 12400, previous: 11200 }, { code: "EG", value: 8100, previous: 8600 }, ]} /> );}Analytics · beta
Live examples and controls: GeoList in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/geo-list.jsonGeoList turns ISO country codes into rows with a flag and the country's name in the active language (via Intl.DisplayNames), then hands them to BreakdownTable. Unknown codes fall back to the code and an "Unknown" label.
When to use
- Audience by country in analytics, search and video reports.
- Any ranking of ISO 3166-1 alpha-2 regions.
When not to use
- Cities or regions without ISO codes: use
BreakdownTable. - A map: this is a list.
Import
import { GeoList } from "@fadymondy/nasaq/web";Quick start
import { GeoList } from "@fadymondy/nasaq/web";
export function Audience() {
return (
<GeoList
valueLabel="Users"
rows={[
{ code: "SA", value: 12400, previous: 11200 },
{ code: "EG", value: 8100, previous: 8600 },
]}
/>
);
}Anatomy
GeoList data-slot="breakdown-table" (BreakdownTable underneath)
row label flag + country nameAPI
GeoList
| Prop | Type | Default | Description |
|---|---|---|---|
rows | readonly GeoRow[] | required | { code, value, previous? }; code is ISO alpha-2. |
valueLabel | ReactNode | required | Heading of the value column. |
title / description | ReactNode | Countries | Card header. |
format | FormatNumberOptions | none | Intl options for values. |
limit | number | 8 | Rows before "Show all". |
invert | boolean | false | Down is good. |
color | string | var(--primary) | Bar colour, a token. |
loading | boolean | false | Skeleton. |
className | string | none | Extra classes on the root. |
labels | Partial<GeoListLabels> & { table? } | none | Own strings plus table for the BreakdownTable strings. |
Examples
Arabic country names:
import { GeoList, NasaqProvider } from "@fadymondy/nasaq/web";
export const Ar = () => (
<NasaqProvider locale="ar">
<GeoList valueLabel="المستخدمون" rows={[{ code: "SA", value: 12400 }, { code: "AE", value: 5200 }]} />
</NasaqProvider>
);Unknown code:
import { GeoList } from "@fadymondy/nasaq/web";
export const Unknown = () => <GeoList valueLabel="Users" rows={[{ code: "ZZ", value: 310 }]} />;Accessibility
Same as BreakdownTable. The flag is an emoji shown with the country name beside it, so the name is always readable.
RTL & i18n
- Country names come from
Intl.DisplayNamesin the active locale. - Flags never mirror.
- Every figure uses the active locale with Western digits and is bidi-isolated (
Num), so+12.4%keeps its order in Arabic.
Styling & tokens
- Colours come from tokens (
--primary,--nq-success,--nq-warning,--nq-danger,--nq-tag-*); never pass raw hex. - Inherits the
BreakdownTableslots.
Do / Don't
- Do pass ISO alpha-2 codes.
- Don't pass country names; they cannot be localised.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-analytics-geo-list--docs
FunnelChart
A marketing funnel chart with stages, counts, conversion and drop-off between steps, a breakdown by source or segment, and a list of saved funnels. Bars grow from the inline start, so it reads right to left in Arabic.
GoogleAnalyticsPage
A Google Analytics report - KPI tiles with comparison, traffic chart, live users, and tabs for sources, pages and audience, with a connect-account screen.