Back to Primitives

MoneyField

1:1Forms
View on GitHub

Currency-formatted input.

Example
Usage
import { MoneyField } from '@/components/polaris';

function Example() {
    return <MoneyField label="Price" value="29.99" />;
}
Component Source
import { forwardRef, createElement } from 'react';

type Props = JSX.IntrinsicElements['s-money-field'];

/**
 * MoneyField component - currency input with formatting.
 *
 * @example
 * <MoneyField label="Price" value="29.99" />
 */
export const MoneyField = forwardRef<HTMLElement, Props>((props, ref) =>
    createElement('s-money-field', { ref, ...props })
);

MoneyField.displayName = 'MoneyField';