docs(responsive): add a Responsive guideline and name what declares the container - #1191
Merged
bert-e merged 1 commit intoAug 28, 2026
Conversation
Contributor
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
…he container Several components adapt to the width they are given by querying a CSS container named `responsive`, and nothing declares that container by default. A component with no declaring ancestor is inert and silent — it renders at full size and nothing reports a problem — so the gap was purely one of documentation: the `iconOnly` prop said it "needs a `responsive` container ancestor" without naming a single way to get one, and none of the three components that declare it said that they do. Adds a `Guidelines/Responsive` page in two parts, so it can grow as more components become responsive: first how to declare the container — which three props do it, why it belongs on the box whose width should drive the reaction rather than as high up as possible, and why containment needs a width from the parent — then a section per responsive component, starting with `Button`'s `iconOnly` and `Form`'s `responsive`. The `iconOnly` section carries a live side-by-side of the same two buttons with and without a declaring ancestor. The prop docs now point both ways: `iconOnly` names the three establishers, and each establisher names what queries the container it declares. Also corrects the form guideline's fluid-field limitation, which still said only `Input` honors it — `Select` has since opted in.
JeanMarcMilletScality
force-pushed
the
improvement/CUI-icononly-container-discoverability
branch
from
August 27, 2026 16:39
e1576cc to
7171d3e
Compare
iconOnly={number} has no responsive container
JeanMarcMilletScality
marked this pull request as ready for review
August 27, 2026 16:47
damiengillesscality
approved these changes
Aug 28, 2026
Contributor
Author
|
/approve |
Contributor
|
I have successfully merged the changeset of this pull request
Please check the status of the associated issue None. Goodbye jeanmarcmilletscality. The following options are set: approve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR — Documents core-ui's responsive capabilities in one guideline page: which three props declare the
responsiveCSS container, and which components query it — starting withButton'siconOnly.Context / Why
Several components adapt to the width they are given by querying a container named
responsive, and nothing declares that container by default. A component with no declaring ancestor is inert and silent: it renders at full size and nothing reports a problem.That made it a documentation gap on both sides. The
iconOnlyprop said it "needs aresponsivecontainer ancestor" without naming a single way to get one, and none of the three components that declare the container mentioned that they do — so there was no way in from either end.🧩 Approach
A
Guidelines/Responsivepage in two parts, shaped so it grows as more components become responsive:Part 1 — declaring the container. The three props that do it, why it belongs on the box whose width should actually drive the reaction rather than as high up as possible (the query resolves against the nearest declaring ancestor, so a container on the page wrapper is the viewport again under another name), and why containment needs a width from the parent.
FormresponsiveBoxcontainerTwoPanelLayoutcontainer="left | right | both"Part 2 — one section per responsive component, starting with
Button'siconOnlyandForm'sresponsive. Adding the next component means adding a section, not restructuring the page.The prop docs now point both ways:
iconOnlynames the three establishers, and each establisher names what queries the container it declares.📷 Screenshots
The new page:
The
iconOnlysection's demo, which the default width cannot show — both frames narrowed to the same 300px. The top one declares the container, so its buttons collapse; the bottom one does not, so they never will:🔍 Review focus
stories/guideline/responsive.mdx— content accuracy, and whether the two-part split is the right shape to hang the next responsive component off. Everything else here is JSDoc.stories/form.guideline.mdx— the "Current limitation" paragraph still claimed onlyInputhonors the fluid width.Selectopted in with CUI-36 and the prop's own JSDoc already said so, so the two contradicted each other; corrected because the new page would inherit the contradiction.🧪 How to test
npm run storybook, open Guidelines → Responsive.iconOnlysection below 360px. Only the top frame — the one wrapped in<Box container>— collapses its buttons to icons; the bottom frame keeps its labels at any width.What changed
No behavioural change:
Buttonv2.component.tsx,Box.ts,Form.component.tsxandlayout/v2/panels.tsxare JSDoc only.stories/guideline/responsive.mdxis the new page, following the existingGuidelines/*pattern, backed byresponsive.stories.tsx— tagged['!dev', '!autodocs']likeselection-controls-overview.stories.tsxso its stories render inside the page rather than as separate sidebar entries.