Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Deductible Slider FAQ Block for React

A FAQ for a home contents insurer with a deductible explainer above the questions: a slider over four deductibles moves two bars, the monthly premium and the most you pay in a year.

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 deductible slider FAQ for React with Base UI. A centred title and sentence sit over a framed card with corner marks: on one side a slider with four stops, $250, $500, $1,000 and $2,500, and on the other two bars that answer it, the premium for a month and the most you would pay yourself in a year. Move to a higher deductible and the premium bar shrinks while the other grows, and a line under the slider says what the stop saves in a year. The bars and the saving are worked out from one typed table, and a quiet line says the figures are examples. Seven questions follow in hairline rows under a rule, each opened by a chevron at its start. On a phone the card stacks. It's built from Accordion, Slider, Button and Guides, with CSS transitions for the bars and your theme's tokens for every colour. For insurers, warranty and service plans, and any product where one setting trades price against risk.

FAQ

How do I change the deductibles and premiums?

Edit STOPS at the top of the file: each stop has a deductibleCents and a premiumCents for a month, lowest deductible first. The slider's range, the tick labels, both bars and the saving line follow the table. CLAIMS_WITH_DEDUCTIBLE sets how many claims in a year carry the deductible, which is also how the second bar, the most you pay in a year, is worked out. The answers quote the same constants.

How are the bars scaled?

Each bar is a share of its own largest stop, so the premium bar is full at the lowest deductible and the other is full at the highest. The width is a CSS variable set from a helper, and it eases over 300 milliseconds, or jumps with reduced motion. The bars are decorative: the figures beside them are text, and the slider announces each stop as "$500 deductible".

How are the amounts written, and what about right-to-left layouts?

Amounts come from one Intl.NumberFormat for US dollars and sit in dir="ltr" spans, so "$2,500" keeps its order in right-to-left layouts, and the bars read from the same side in every direction. The chevron at the start of each question points toward the reading direction.

Are the closed answers in the page's markup?

Yes. The Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found". One answer is open at a time.

How does it work with a keyboard and a screen reader?

The slider is a single control: the arrow keys move it one stop, Home and End jump to the ends, and the saving line under it is a polite status that is read out as the stop changes. The four amounts under it are buttons that jump to a stop. Each question is a button inside its own h3 under the section's h2.

How does it fit on a phone?

Below the md breakpoint the card stacks: the slider with its four amounts first, then the two bars. The saving line keeps room for two lines, so moving the slider never shifts the questions below, and the first question starts well inside the first screen. Nothing scrolls sideways at 320 pixels.

  • Pro

    A split pricing section for a VPN with a contract length slider from 1 to 24 months in a card in a card, where the monthly price at display size, the discount, total and savings roll to each term, and a sticky bar on phones.

  • Pro

    A seat calculator: a slider sets the team size with its count riding the thumb, ticks at the 10, 25 and 50 seat discounts, shortcuts to them, and a panel that rolls the seat price and monthly total.

  • Pro

    Fee Calculator FAQ

    Calculators and tools

    A FAQ for a business bank whose first answer is a fee calculator: an amount field and a three-way speed control show the fee, the total and the arrival time, beside five questions on safety and limits.

  • Pro

    Fee Guide FAQ

    Calculators and tools

    A FAQ for a law firm with a matter-type fee guide beside its title: a select of four matters over the typical cost, time, who leads and what an instalment plan comes to, then seven numbered questions.

  • Pro

    A centered showcase hero with two actions over a framed calculator: a team-size slider beside an estimate of the annual savings, which rolls to each new figure.

  • Pro

    Procurement Pack FAQ

    Calculators and tools

    A FAQ for a data platform with a procurement pack beside the questions: three documents as checkboxes with a live count, an email field and one Shine Button that requests what is ticked.