Skip to content

Comments

feat: add reusable Modal component with ARIA accessibility closes #71#129

Open
AYo101o wants to merge 1 commit intoWeb3Novalabs:mainfrom
AYo101o:feat/reusable-modal
Open

feat: add reusable Modal component with ARIA accessibility closes #71#129
AYo101o wants to merge 1 commit intoWeb3Novalabs:mainfrom
AYo101o:feat/reusable-modal

Conversation

@AYo101o
Copy link

@AYo101o AYo101o commented Feb 20, 2026

♿ Reusable Modal Component with ARIA Accessibility

Closes #71

What this PR does

Adds a reusable <Modal /> base component at components/ui/Modal.tsx that any dev can use to build modals across the project, styled consistently with Nevo's dark theme.

Features

  • Accessible by defaultrole="dialog", aria-modal="true", aria-labelledby for the title, aria-describedby for the subtitle, and aria-label on the close button
  • Focus trap — Tab and Shift+Tab cycle stays within the modal when open
  • Keyboard supportEscape key closes the modal
  • Focus restoration — returns focus to the trigger element on close
  • Backdrop click to close — with optional disableBackdropClose prop
  • Flexible API — accepts title, subtitle, children, footer, and size (sm | md | lg | xl) props
  • Fully responsive across all screen sizes
  • Styled with Nevo's color palette (#0a1428 bg, #1fe4ff cyan accent, #10b981 green)

Usage

<Modal
  isOpen={open}
  onClose={() => setOpen(false)}
  title="Confirm Action"
  subtitle="This cannot be undone."
  size="md"
  footer={<button onClick={() => setOpen(false)}>Confirm</button>}
>
  <p>Modal content here.</p>
</Modal>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a reusable "Modal"

1 participant