Skip to content

Components

NumericValue

999 credits remaining

Component reference

Properties

Use NumericValue

Format a number with tabular figures and optional space for its expected width.

Example import style
numeric-value.tsxTSX
"use client";

import { FloodRoot, NumericValue } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <NumericValue value={999} reserveFor={-9999} lang="en" />
    </FloodRoot>
  );
}

Design notes

  • Use in measurements, counters and numerical columns. Supply a finite number or a bigint for an exact large integer. Native NumberFormat options control separators, rounding, units and currency. The data element preserves the underlying value.
  • Use reserveFor only where changing width moves neighboring content. Choose a representative widest value in the same notation, including signs, grouping, fractions or currency where they may appear.
  • The value can grow beyond the reserve. Align end for comparable values or start when the figure is read from a shared leading edge. When values could outgrow the available width, define the wrapping or overflow behavior in the enclosing composition.
  • Use Duration when elapsed time needs a fixed unit and MoneyField when the user edits an exact monetary amount.

API reference

PropValuesDefault
valuenumber | bigintRequired
formatOptionsIntl.NumberFormatOptions—
reserveFornumber | bigint—
align"start" | "end""end"
Native HTML propsOmit<HTMLAttributes<HTMLDataElement>, "children">Forwarded
View TypeScript source