Back to all examples

Ask a user for dollar amounts

ReactAngularWeb Components
const [tuitionAmount, setTuitionAmount] = useState("");
  const [suppliesAmount, setSuppliesAmount] = useState("");
  const [othersAmount, setOthersAmount] = useState("");
<GoabFormItem label="Tuition">
        <GoabInput
          onChange={(e) => setTuitionAmount(e.value)}
          value={tuitionAmount}
          name="tuitionAmount"
          leadingContent="$"
        />
      </GoabFormItem>
      <GoabFormItem label="Books/Supplies/Instruments" mt="l">
        <GoabInput
          onChange={(e) => setSuppliesAmount(e.value)}
          value={suppliesAmount}
          name="suppliesAmount"
          leadingContent="$"
        />
      </GoabFormItem>
      <GoabFormItem label="Other costs" mt="l">
        <GoabInput
          onChange={(e) => setOthersAmount(e.value)}
          value={othersAmount}
          name="othersAmount"
          leadingContent="$"
        />
      </GoabFormItem>

Prompt users to enter monetary values using a consistent input format that supports validation and currency symbols.

When to use

Use this pattern when:

  • Collecting cost or expense information
  • Users need to enter multiple monetary values
  • You want consistent currency formatting

Considerations

  • Use the leadingContent prop to show the $ symbol
  • Consider if decimal places are needed
  • Group related amounts together
  • Provide clear labels for each amount field