Results for “Lists & control flow”
Small, practical examples. Search by task or narrow things down below.
Remove a hidden element’s layout space
CSS: Display none removes a box from layout as well as hiding its contents.
CSS✓ Tested
Remove one handler without removing others
jQuery: Pass the original function reference to off.
jQuery✓ Tested
Remove related events by namespace
jQuery: Namespaced events let a feature clean up its own handlers.
jQuery✓ Tested
Render a helpful empty state
Render a helpful empty state with a small React component and explicit browser behavior.
React✓ Tested
Render a semantic data table
Render a semantic data table with a small React component and explicit browser behavior.
React✓ Tested
Render nested groups with stable keys
Render nested groups with stable keys with a small React component and explicit browser behavior.
React✓ Tested
Reserve space for a visible border
CSS: A border adds to the outer dimensions of a content-box element.
CSS✓ Tested
Respond to the Enter key
jQuery: Use the event key rather than deprecated numeric key codes.
jQuery✓ Tested
Scroll wide code locally
Keep long code inside a horizontally scrollable CSS container.
CSS✓ Tested
Separate an underline from the text
CSS: Text-underline-offset improves the gap between letters and a decorative underline.
CSS✓ Tested
Set an explicit font weight
CSS: Numeric font weights express typographic emphasis independently of a specific font family.
CSS✓ Tested
Show the count of matching records
Show the count of matching records with a small React component and explicit browser behavior.
React✓ Tested