Components
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.
npx @21st-dev/cli add reshaped/reshaped-modalLoading preview...
import { Button, Dismissible, Reshaped, useToggle, View } from "reshaped/bundle";
import Modal from "@/components/ui/reshaped-modal";
function Component() {
const { active, activate, deactivate } = useToggle(false);
return (
<>
<Button onClick={activate}>Open modal</Button>
<Modal active={active} onClose={deactivate}>
<View gap={3}>
<Dismissible onClose={deactivate} closeAriaLabel="Close modal">
<Modal.Title>Modal title</Modal.Title>
<Modal.Subtitle>Modal subtitle</Modal.Subtitle>
</Dismissible>
<View backgroundColor="neutral-faded" height={10} />
</View>
</Modal>
</>
);
}
export default function Demo() {
return (
<Reshaped theme="slate">
<div style={{ margin: "0 auto", padding: 24, display: "flex", justifyContent: "center" }}>
<Component />
</div>
</Reshaped>
);
}
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...