Skip to content

Conversation

@dmj900501
Copy link

@dmj900501 dmj900501 commented Nov 19, 2025

Description

This PR add an optional responsive svg grid background (demo below). User can add an optional "background" prop to show a grid background with defined color.

The background also works with different combination of container padding / margin / gap

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Screen.Recording.2025-11-19.at.10.47.52.mov

with different [color/margin/padding]

Screen.Recording.2025-11-19.at.14.49.11.mov

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 examples
  • 🙅 no documentation needed

@github-actions github-actions bot added documentation use this label for changes in documentation core use this label for changes in `lib` directory labels Nov 19, 2025
@dmj900501 dmj900501 marked this pull request as draft November 19, 2025 10:06
@dmj900501 dmj900501 marked this pull request as ready for review November 19, 2025 13:45
@STRML
Copy link
Collaborator

STRML commented Dec 9, 2025

I'm working this in to #2183 as I see the value but I also don't think it should live in the main library (ie it should fit the API of the library and be tree-shakable). Thanks for submitting it.

@STRML STRML closed this Dec 9, 2025
STRML added a commit that referenced this pull request Dec 9, 2025
… utility

Add new extras entry point with optional tree-shakeable components:
- GridBackground: SVG grid background that aligns with GridLayout cells
- calcGridCellDimensions: Core utility for grid cell calculations

Based on PR #2175 by @nicosayer.

Also improves ESLint configuration:
- Add typescript-eslint for TypeScript file linting
- Add eslint-plugin-react-hooks
- Rename eslint.config.js to eslint.config.mjs for explicit ESM
- Ignore built example files
- Disable React Compiler rules (not using React Compiler yet)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@dmj900501
Copy link
Author

@STRML Thanks for the response. I saw the your changes are merged. Just want to point out, in the README you mentioned the background is based on this PR by the wrong person.

IMG_2082

STRML added a commit that referenced this pull request Dec 9, 2025
Change credit from @nicosayer to @dmj900501 who is the actual author
of the GridBackground feature PR.
@STRML
Copy link
Collaborator

STRML commented Dec 10, 2025

Thanks, fixed it.

STRML added a commit that referenced this pull request Dec 10, 2025
* feat(extras): add wrap compactor for paragraph-style layouts

Implements wrap mode compaction where items flow left-to-right and wrap
to the next row, similar to words in a paragraph. When dragging:
- Moving an item earlier shifts other items right/down
- Moving an item later shifts other items left/up

This is a v2 reimplementation of the algorithm from PR #1773 by
@JohnThomson, adapted to the new composable Compactor interface.

Usage:
```tsx
import { wrapCompactor } from 'react-grid-layout/extras';
<GridLayout compactor={wrapCompactor} ... />
```

* fix(readme): correct attribution for PR #2175

Change credit from @nicosayer to @dmj900501 who is the actual author
of the GridBackground feature PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core use this label for changes in `lib` directory documentation use this label for changes in documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants