
Input OTP Component
Components
An animated dialog with trigger-origin expansion, elastic movement, coordinated content transitions, and responsive feedback for modal interactions.
Dialog can grow from the button that opened it and shrink back on close, with optional elastic overshoot. Content fades and scales in after the panel arrives, and a blocked outside click can trigger a brief shake while a dimmed or blurred backdrop keeps focus on the dialog.
Use it when users must review information, confirm an action, or finish a short task before returning, such as subscription changes, destructive confirmations, and account settings. It should always be clear why it opened and how to continue or leave.
Choose clear, dimmed, or blurred backdrops, panel roundness, and a trigger with rolling text or pointer-origin fill. Opening options include origin from trigger, elastic, duration, bounce, and content fade and scale, while closing options cover exit animation, content fade-out, click-outside dismissal, and shake when blocked.
A subscription dashboard can open a Pause subscription dialog from its button, explaining billing effects. Outside clicks are blocked with a shake, Confirm stays pending until the service responds, and Cancel shrinks it back to the trigger.
A project tool can use a dimmed dialog to confirm archiving a project, keeping the board visible behind it so users remember what they’re acting on.
An account settings page can open a small form dialog to update an email address, with elastic entry kept subtle so the form stays easy to read.
Routine actions that can complete safely inline are better confirmed with inline feedback or a Toast.
Long content or multi-step workflows belong on a dedicated page, and supporting details may suit a drawer or Tooltip instead.
Don’t use excessive shake or overshoot to force attention, since high-stakes actions need clear wording, not more motion.
Measure trigger and panel geometry once rather than per frame, use transforms and opacity, and keep backdrop and panel in sync. Let elastic motion settle quickly, keep content fades short, and clean up listeners and focus state on close.
Use a dialog role with an accessible title, move focus inside and trap it while open, make the background inert, and return focus to the trigger on close. Support Escape where appropriate, and never leave users without a way to cancel when outside clicks are blocked. On mobile, fit the viewport and keyboard, scroll long content internally, and keep actions reachable. With reduced motion, remove expansion, bounce, scaling, and shaking.
| Prop | Type | Default | Description |
|---|---|---|---|
theme | string | valorant | Colour palette, dialog included. Its primary colour fills the main button and the hover fill. |
mode | string | dark | Light or dark version of the palette. Starts dark. |
rollingText | boolean | true | The trigger and button labels roll to a second copy on hover. |
fillOnHover | boolean | true | Buttons fill with colour from the edge on hover. |
originFromTrigger | boolean | true | The dialog grows out of the button that opened it instead of the centre. |
elastic | boolean | true | The dialog springs in with a slight overshoot. |
duration | number | 0.4 | How long the open animation takes, in seconds. |
bounce | number | 0.2 | How much the dialog overshoots and settles. 0 is no bounce. |
fadeContent | boolean | true | Fades the dialog contents in as it opens. |
scaleContent | boolean | false | Scales the dialog contents up with the dialog. |
exitAnimation | string | fade | How the dialog leaves: fades, drops down, or shrinks. |
fadeContentOut | boolean | true | Fades the contents out when the dialog closes. |
dismissible | boolean | true | Clicking outside the dialog closes it. When off, the dialog shakes instead if Shake when blocked is on. |
shakeOnBlock | boolean | true | The dialog shakes when you click outside and it can't close. |
backdrop | string | blur | What sits behind the dialog: nothing, a dim layer, or a blur. |
rounded | string | md | Corner radius of the dialog. |
Dialog is an animated React component that shows a focused panel over the page, with trigger-origin transitions, elastic expansion, staged content, backdrops, and configurable dismissal.
Yes. Origin from trigger grows the panel from the recorded trigger position and can return it there on close.
No. Bounce only applies when Elastic is enabled.
Yes. Click outside closes controls this and can be disabled when users must make an explicit choice.
It briefly shakes the dialog when an outside click isn’t allowed to close it. It’s ignored when dismissible is true.
No. The application connects confirmation to its logic, including validation, permissions, requests, and errors.
Need a custom effect? Tell us what to create.