reshaped

Reshaped Modal

Forms

About

Controlled overlay dialog with an active flag and onClose handler that locks page scroll while open. Supports center, bottom, start, end and full-screen positions with matching slide animations, custom size and padding, Modal.Title/Subtitle composition with the Dismissible utility, focus management and a transparent overlay mode for side panels.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Reshaped Modal to your project and fits it to your theme.

Code

How Reshaped Modal is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import * as React from "react";
import {
  Button,
  Dismissible,
  Reshaped,
  TextField,
  useToggle,
  View,
} from "reshaped/bundle";
import Modal from "@/components/ui/reshaped-modal";

function Component() {
  const { active, activate, deactivate } = useToggle(false);
  const inputRef = React.useRef<HTMLInputElement>(null);
  const handleOpen = () => inputRef.current?.focus();
  return (
    <>
      <Button onClick={activate}>Open modal</Button>
      <Modal active={active} onClose={deactivate} onAfterOpen={handleOpen}>
        <View gap={3}>
          <Dismissible onClose={deactivate} closeAriaLabel="Close modal">
            <Modal.Title>Modal title</Modal.Title>
            <Modal.Subtitle>Modal subtitle</Modal.Subtitle>
          </Dismissible>
          <Button onClick={() => {}}>Focusable button</Button>
          <TextField
            name="name"
            placeholder="Enter your name"
            inputAttributes={{ ref: inputRef }}
          />
        </View>
      </Modal>
    </>
  );
}

export default function Demo() {
  return (
    <Reshaped theme="slate">
      <div style={{ margin: "0 auto", padding: 24, display: "flex", justifyContent: "center" }}>
        <Component />
      </div>
    </Reshaped>
  );
}

Dependencies

More by reshaped

View all
  • Reshaped Toast

    Reshaped Toast

    9
  • Reshaped Calendar

    Reshaped Calendar

    9
  • Reshaped Progress indicator

    Reshaped Progress indicator

    7
  • Reshaped Context menu

    Reshaped Context menu

    7
  • Reshaped Checkbox

    Reshaped Checkbox

    7
  • Reshaped Autocomplete

    Reshaped Autocomplete

    7
  • Reshaped Pagination

    Reshaped Pagination

    6
  • Reshaped Carousel

    Reshaped Carousel

    6

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83