nalarx-ui
Components

UI strings

The text primitives show or announce on their own, in English by default, swappable for the app's translations.

bunx shadcn@latest add @nalarx/ui-strings

Some text sits where a caller never sees it: a skeleton's busy label, a dialog's default buttons, a toast's dismiss button. Items read it from useUIStrings(), so an app wires its translations once instead of passing a label to every instance.

Without a provider

Everything is English (DEFAULT_UI_STRINGS). The Platform app needs nothing.

With a provider

Put one client component near the root that maps the app's i18n to UIStrings. Keys you leave out stay English.

"use client";
import { UIStringsProvider } from "@/components/ui/nx/UIStrings";
import { useTranslation } from "@/hooks/shared/i18n/useTranslation";

export function UIStringsBridge({ children }: { children: React.ReactNode }) {
  const { t, language } = useTranslation();
  return (
    <UIStringsProvider
      strings={{
        locale: language === "id" ? "id-ID" : "en-US",
        close: t("ui.close"),
        loading: t("ui.loading"),
        // …
      }}
    >
      {children}
    </UIStringsProvider>
  );
}

The same reader outside a provider, then inside one that sets close and retry:

close
Close
retry
Retry
pageOf(2, 5)
Page 2 of 5
close
Tutup
retry
Coba lagi
pageOf(2, 5)
Page 2 of 5
close
Close
retry
Retry
pageOf(2, 5)
Page 2 of 5
close
Tutup
retry
Coba lagi
pageOf(2, 5)
Page 2 of 5

Precedence

A prop on the component (ariaLabel, retryLabel, placeholder…) wins, then the provider, then the English default.

Strings

KeyDefaultUsed by
localeen-USDate picker
closeCloseModal close button, dialogs
loadingLoadingSkeleton, loading overlay
retryRetryError state
ok, cancel, confirmOK, Cancel, ConfirmApp dialog
typeToConfirmPrefix, typeToConfirmSuffixType … to confirm:App dialog
selectPlaceholder, searchPlaceholder, searchAriaLabel, noMatchesSelect, Search…, Search options, No matchesSelect
toastRegion, dismiss, dismissNotificationNotifications, Dismiss, Dismiss notificationToast
paginationLabel, previous, next, rowsPerPagePagination, Previous, Next, Rows per pagePagination
showingRange(from, to, total), pageOf(page, total), pageNumber(page)Showing 1–10 of 40, Page 1 of 4, Page 1Pagination
datePlaceholder, today, clear, previousMonth, nextMonthPick a date, Today, Clear, Previous month, Next monthDate picker

On this page