-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a show more / show less button to component or pattern demos to expand or collapse the code snippet. #774
Comments
DBD324
moved this from Design to-do
to Design In progress
in Intelligence Community Design System
Jan 24, 2024
DBD324
moved this from Design In progress
to In Refinement
in Intelligence Community Design System
Jan 29, 2024
ASM995
moved this from In Refinement
to Ready for dev
in Intelligence Community Design System
Feb 1, 2024
Just another thing to keep in mind about this - when the user clicks the "Copy code" button, we'd probably want it to copy whichever amount of code is visible, i.e. once you've expanded the code, it will change to copying the longer amount code. |
GCHQ-Developer-112
moved this from Ready for dev
to Dev In Progress
in Intelligence Community Design System
Apr 9, 2024
GCHQ-Developer-112
moved this from Dev In Progress
to In Review
in Intelligence Community Design System
Jun 13, 2024
GCHQ-Developer-112
moved this from In Review
to Done
in Intelligence Community Design System
Jun 14, 2024
GCHQ-Developer-112
closed this as completed
by moving to Done
in
Intelligence Community Design System
Jun 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Some code snippets are very long and if displayed in full would cause the page length to be very long. A show more / show less button would allow the snippets to be collapsed when not in use reducing the page length.
💬 Description
Explore ways of adding show more/less to component demos.
Consider a button in the toolbar, a text link in the snippet itself, or a floating action button.
💰 User value
Allows pages to be shortened avoiding lengthy page scrolls. Allows full code to be viewed upon request.
📚 User Stories
If relevant, describe the high-level functionality as user stories.
As an ICDS user:
I need to be able to expand and collapse code snippets
So that they don't cause page lengths to be unnecessarily long.
📝 Acceptance Criteria
If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.
Given that a code demo is being set up
When being configured
Then an option exists to allow the snippet to be expandable
and an option exists to set initial state of collapsed or expanded,
and an option exists to set the number of lines displayed in the collapsed state.
Given that an expandable code snippet is being set up
When specifying the code
Then an option exists to specify the collapsed code in full, and the expanded code in full.
(this is so that aspects of the code can be hidden from the start of the snippet as well as the end, such as with imports)
Given that an expandible code demo exists
When an external trigger occurs
Then an option to programmatically control the expansion can be used.
Given that an expandible code demo exists
When rendered
Then a UI control exists to expand or collapse the snippet.
Given that an expandible code demo exists
When the expand button is actioned,
Then the code snippet should expand to show the snippet in full
And page content below should be pushed to accommodate.
✏ Designs
Please see the 'Component Library - ICDS Guidance Site' Figma file for visual designs.
## 🧾 Guidance
N/A
Additional info
Tell us anything else useful to help us understand your suggestion.
The text was updated successfully, but these errors were encountered: