Skip to Content
better-auth-nuvion

Styling the admin view

Make the payments admin view match your product with class names, CSS variables, labels and row actions, and what it does and does not do for security.

@umohpyro/better-auth-nuvion/react ships a payments table with leg progress, a Retry button on partial payments and a button that reconciles stuck transfers. It renders plain elements with class names and no inline styles, so you decide how it looks and it works under a strict Content Security Policy. react is an optional peer dependency.

import { PaymentsAdmin } from "@umohpyro/better-auth-nuvion/react";
import "@umohpyro/better-auth-nuvion/react.css"; // optional default look

<PaymentsAdmin api={authClient.nuvion} organizationId={orgId} />

Without the stylesheet the view is unstyled HTML, which is the right starting point for your own design system.

Three ways to style it

1. The default look, with your colours

react.css is optional. Every rule in it has zero specificity (:where), so any rule of yours wins without !important. Change the look with variables:

.payments-admin {
  --pay-ok: #0a7d3c;
  --pay-bad: #a11d1d;
  --pay-radius: 999px;
  --pay-cell-y: 14px;
}
VariableControlsDefault
--pay-borderBorders of cells and buttonscurrentColor at 18%
--pay-hoverRow and button hover backgroundcurrentColor at 8%
--pay-oksettled and refunded text#1f7a4a (dark: #6fd69b)
--pay-badpartial, refund_partial and error text#b42323 (dark: #ff9b94)
--pay-focusFocus ring on buttons#d3166a (dark: #ff77ae)
--pay-radiusButton corner radius8px
--pay-font-sizeTable and button text14px
--pay-cell-y, --pay-cell-xCell padding10px, 12px
--pay-button-y, --pay-button-xButton padding6px, 12px

The stylesheet follows prefers-color-scheme, a .dark class or data-theme="dark" on any ancestor, and the matching .light or data-theme="light". Status colours meet 4.5:1 on a white or near-black page.

2. Your own CSS

Skip the stylesheet and target the classes, or the data-status attribute that rows and status cells carry:

.payments-table__status[data-status="settled"] { color: seagreen; }
.payments-table__status[data-status="partial"] { color: crimson; }
.payments-table__status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; }

3. Tailwind or a design system

unstyled drops the default class names so only yours apply, and classNames takes one string per part:

<PaymentsAdmin
  api={authClient.nuvion}
  organizationId={orgId}
  unstyled
  classNames={{
    root: "space-y-3",
    toolbar: "flex gap-2",
    button: "rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",
    table: "w-full text-sm",
    th: "p-2 text-left font-medium border-b",
    td: "p-2 border-b",
    status: "font-semibold data-[status=partial]:text-red-600 data-[status=settled]:text-green-700",
  }}
/>

Without unstyled, your class names are added after the defaults.

Parts

Each key of classNames is one part. The default class applies unless unstyled is set.

PartDefault classElement
rootpayments-adminsection around everything
toolbarpayments-admin__toolbardiv holding the two buttons
buttonpayments-admin__buttonevery button (toolbar and Retry)
errorpayments-admin__errorp role="alert" with a server error
tableWrappayments-tablediv around the table (the scroll container)
tablepayments-table__tabletable
th, tr, tdpayments-table__th, __tr, __tdheader cell, row, cell
timepayments-table__timetime in the Created cell
referencepayments-table__referencecode with the payment reference
statuspayments-table__statusthe Status cell (also has data-status)
retrypayments-table__retrythe Retry button (also has the button class)
emptypayments-table__emptyp shown when there are no payments

data-status is one of the payment statuses on the row and on the Status cell.

Props

PaymentsAdmin fetches and refreshes by itself. PaymentsTable is the same table for data you load yourself (payments, onRetry, busyId). Both take:

PropTypePurpose
classNamesPartial<Record<Part, string>>Class names per part
unstyledbooleanDrop the default class names
labelsPartial<Labels>Replace any text, for wording or translation
formatDate(ms: number) => stringReplace the default 2026-11-19 09:30 (UTC)
renderActions(payment) => ReactNodeYour own buttons or links in each row's last cell

PaymentsAdmin also takes api, organizationId and pollMs (refresh interval, default 15000).

<PaymentsAdmin
  api={authClient.nuvion}
  organizationId={orgId}
  labels={{
    reconcile: "Vérifier les virements bloqués",
    retry: "Réessayer",
    legsSummary: (done, total, failed) => `${done}/${total} terminés${failed ? `, ${failed} en échec` : ""}`,
  }}
  formatDate={(ms) => new Date(ms).toLocaleString("fr-FR")}
  renderActions={(payment) => <a href={`/orders/${payment.id}`}>Open</a>}
/>

labels has reconcile, refresh, retry, retrying, empty, loadFailed, requestFailed, table, created, reference, amount, status, legs and the legsSummary function.

Security

  • No inline styles, no scripts, no raw HTML. Every value, including payment references and error messages that come from the server, is rendered as text by React. A reference like <img onerror=...> shows as literal text. This is covered by a test.
  • Works under a strict CSP. Nothing needs style-src 'unsafe-inline'. The stylesheet is a normal file you import.
  • Authorization is on the server. The view only calls the plugin's endpoints, which require an owner or admin of the organization. Hiding or restyling the view does not grant or remove access.
  • No secrets in the browser. The view talks to your own Better Auth endpoints. The Nuvion key stays on the server.
  • renderActions and classNames are your code. The view passes the payment row to renderActions and nothing else, and it does not evaluate any string you give it.

Accessibility

Headers carry scope="col", the table has an aria-label (the table label), buttons are real button elements with type="button", busy buttons set aria-busy, each Retry button's accessible name includes the payment reference, and errors use role="alert". Status is text, never colour alone.

On this page