Skip to content

feat(modal): add "full" size option - #524

Open
ubf-hunter wants to merge 1 commit into
codegouvfr:mainfrom
ubf-hunter:feat/modal-full-size
Open

ubf-hunter wants to merge 1 commit into
codegouvfr:mainfrom
ubf-hunter:feat/modal-full-size

Conversation

@ubf-hunter

Copy link
Copy Markdown

Closes #513

What

Adds a "full" value to Modal's size prop, alongside the existing "small" | "medium" | "large", mapped to fr-col-12 fr-col-md-12 fr-col-lg-12.

Why

As raised in #513, the modal width is currently capped at three fixed sizes. Nothing in the DSFR prevents a fr-col-lg-12 modal, and there are legitimate use cases (e.g. previewing a document before upload, with extra context fields) where a full-width modal is the right call.

Changes

  • src/Modal/Modal.tsx: add "full" to the size union type and its corresponding case in the width switch.
  • stories/Modal.stories.tsx: add "full" to the Storybook size control options (kept in sync with the type via the existing assert<Equals<...>> check).

This is purely additive — default ("medium") and existing sizes are untouched.

The modal width was capped at three fixed sizes (small/medium/large),
with no option to use the full available page width. Nothing in the
DSFR itself prevents a fr-col-lg-12 modal, and there are legitimate
use cases (e.g. previewing a document before upload) where a
full-width modal makes sense.

Add a "full" value to the size prop, mapped to
fr-col-12 fr-col-md-12 fr-col-lg-12, alongside the existing sizes.

Closes codegouvfr#513
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.

Permettre d'afficher la modale en grand

1 participant