Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Loan Payment Slider Contact Block for React

A personal-loan request for a lender: an amount slider with a tick at each $5,000 and a term to pick, a panel that works the monthly payment out as you move, and a form that checks itself.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A loan request section for React with Base UI, laid out as two columns of cells on shared hairlines under a start-aligned header. At the start, a slider for the loan amount ($2,000 to $40,000, with a tick at each $5,000 and the amount in large type), four term tiles (12, 24, 36 or 48 months), then a name, an email, your yearly income in a number input and a checkbox that agrees to a credit check. At the end, a live panel with the monthly payment worked out at one fixed example rate, the interest and the total repaid, and the payment's share of your monthly income once you have typed it. On a phone the panel comes straight after the slider and the term, so the figure is never far from the control. Submitting checks every field, shows each problem under its field and moves focus to the first one; a valid request turns into a confirmation in the same space, which takes focus. It's built from Slider, Segment Group, Number Input, Checkbox, Field, Input, Sliding Number, Guides and Shine Button, with your theme's tokens for every colour. For lenders, credit unions and any page where the first question is "what would it cost me?".

FAQ

How is the monthly payment worked out?

With the standard formula for a fixed-rate loan: the amount times the monthly rate, divided by one minus the monthly rate plus one raised to the power of minus the number of months. The rate is one constant at the top of the file, APR (9.9% a year, a made-up figure), and every other number in the panel follows from the payment: the total repaid is the payment times the months, and the interest is what is left after the amount. They are example figures only; the panel says so, and nothing in it is an offer of credit or advice.

How does the slider work with a keyboard and a screen reader?

It moves in steps of $500 with the arrow keys, and Page Up and Page Down jump further. Its thumb is named "Loan amount" and a screen reader hears the value as dollars ("$12,000"). The tick marks under the track are decoration (they are hidden from assistive technology); the amount in large type is the visible value. When you stop moving, or choose a term, one hidden status line says the amount, the term and the payment in a sentence, so nothing is announced while you drag.

How does the form check what's typed?

The form has noValidate, so the browser's own bubbles stay away and the block shows its own messages. On submit, problems checks a name, an email address with an @ and a domain, an income above zero and the credit-check box. Each problem appears under its field with an icon, the control is marked invalid and described by the message, and focus moves to the first one. Leaving a filled field checks it, and editing a field that shows an error re-checks it as you type.

Where does the form send its data?

Nowhere yet. The submit handler waits 800 milliseconds as a stand-in for a request, then shows the confirmation. Replace that timer in submit with your own call: details holds the amount, the term, the income, the name, the email and the consent. The confirmation repeats the amount, the term and the example payment, and says a loan officer will write to the address given; it promises nothing else.

Why does the panel mention my income?

Once you type your yearly income the panel shows the payment as a share of your monthly income, and says so when it passes 40%. The limit is HEAVY at the top of the file. It is a prompt to try another amount or term, not a rule: the form still sends.

How does it fit on a phone?

Below lg the cells stack: the amount and the term, the payment panel, then your details and the button, each divided by a hairline. The term tiles stay four across (the number over "months") down to 320 pixels, name and email go one per row, and the button goes full width. The panel's details line keeps its height as the income comes in, so nothing below it moves.

  • Pro

    Budget Range Slider Contact

    Quotes and estimates

    A roofing quote request as a card in a card: three kinds of job, a two-thumb budget slider that says in words what the range covers, and a short form that checks itself.

  • Pro

    Premium Builder Contact

    Finance and property

    A home-cover quote for an insurer, split by a hairline: a slider over five levels of cover and three risk switches at the start, a premium built line by line and a short form at the end.

  • Pro

    A portfolio inquiry for an advisory firm: a risk slider over five named profiles that redraws a stacked bar of stocks, bonds and cash at full width, then a short inquiry form on ruled bands.

  • Pro

    A usage-based bill calculator for a search API: a slider over monthly search volumes sits in one short band, and a meter of what the plan covers and what is billed as overage rolls the estimated bill beside it.

  • Pro

    A receipt that prices itself, for a webhook-delivery service: number steppers for seats, events and days of history drive a live bill that stamps the cheapest plan and itemises what goes past its allowance.

  • Pro

    A talk-to-sales split for a scheduling platform: what happens next as three numbered steps and a band of contact details beside a form that checks itself, shows each problem under its field and confirms in place.