Skip to content

feat(widgets): add inner padding property to container-like widgets#41625

Draft
sebastianiv21 wants to merge 5 commits intoreleasefrom
409-container-content-padding
Draft

feat(widgets): add inner padding property to container-like widgets#41625
sebastianiv21 wants to merge 5 commits intoreleasefrom
409-container-content-padding

Conversation

@sebastianiv21
Copy link
Contributor

@sebastianiv21 sebastianiv21 commented Mar 17, 2026

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Adds a single, consistently named inner padding property to Container, Form, Tabs, List, and JSON Form so builders can control content inset and avoid content touching the widget border or being cropped.

  • Property name: contentPadding (Style panel label: Padding (px)).
  • Value format: 1–4 space-separated numbers in pixels (CSS order). Examples: 10 (all sides), 10 20 (vertical, horizontal), 10 20 10 20 (top, right, bottom, left). Invalid values are rejected by validation.
  • Defaults: Container, Form, Tabs, and List default to "4"; JSON Form defaults to "25" for backward compatibility.
  • List: Padding applies to the list container only (inset between the list border and the scrollable content). Item spacing between list items is unchanged and controlled by the existing Item Spacing property.

All five widgets use the same property name, label, validation, and value format in the Style panel.

Fixes #4790
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/23176283611
Commit: 6c9b354
Cypress dashboard.
Tags: @tag.All
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Tue, 17 Mar 2026 03:02:51 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

…dgets

- Introduced `DEFAULT_CONTENT_PADDING` constant for default inner content padding.
- Implemented `parseContentPadding` function to handle various padding input formats and return appropriate values.
- Updated `ContainerWidget` and `FormWidget` to utilize the new content padding feature.
- Enhanced tests for `parseContentPadding` to ensure correct parsing and default behavior.

This change improves the flexibility of widget styling by allowing customizable padding options.
… options

- Added `contentPaddingValidation` function to validate and parse content padding inputs for container-like widgets.
- Updated `ContainerWidget` to utilize the new validation function for content padding properties.
- Enhanced unit tests for `contentPaddingValidation` to cover various input scenarios, ensuring robust validation logic.

This change improves the user experience by allowing more flexible and error-resistant padding configurations.
- Introduced `contentPadding` property to `JSONFormWidget`, `ListWidgetV2`, and `TabsWidget` for customizable inner padding.
- Updated relevant components to utilize the new padding feature, allowing for flexible styling options.
- Implemented validation for `contentPadding` input to ensure correct formatting and usability.
- Enhanced documentation and property configuration for better user guidance on padding settings.

This change improves the visual consistency and user experience by allowing developers to specify padding for various widgets.
- Changed section name from "Border and shadow" to "Border, shadow & padding" across multiple widgets for consistency.
- Enhanced help texts for `contentPadding` in `ContainerWidget`, `JSONFormWidget`, and `ListWidgetV2` to provide clearer instructions on padding usage.

These updates improve the user experience by ensuring better understanding and consistency in widget configurations.
@sebastianiv21 sebastianiv21 added the ok-to-test Required label for CI label Mar 17, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0a465511-0508-4779-a881-02b74e67a488

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 409-container-content-padding
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting to disable sequence diagrams in the walkthrough.

@github-actions github-actions bot added Container Widget Container widget Enhancement New feature or request Needs Design needs design or changes to design Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Tab Widget Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets and removed Enhancement New feature or request labels Mar 17, 2026
@sebastianiv21
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/23175709729.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41625.
recreate: .
base-image-tag: .

@github-actions
Copy link

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 6, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

You can view the dependency diff in the run log. Look for the check-cyclic-dependencies job in the run.

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41625.dp.appsmith.com

- Added `validatePaddingString` function to validate and parse content padding inputs, ensuring they consist of 1 to 4 non-negative space-separated numbers.
- Removed the deprecated `contentPaddingValidation` function from `WidgetUtils` and updated relevant widgets (`ContainerWidget`, `JSONFormWidget`, `ListWidgetV2`, `TabsWidget`) to utilize the new validation function.
- Enhanced property configurations to reflect the new validation logic, improving consistency and usability across widgets.

This change streamlines padding validation and enhances the user experience by providing a unified approach to padding input validation.
@github-actions github-actions bot added the Enhancement New feature or request label Mar 17, 2026
@github-actions
Copy link

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

You can view the dependency diff in the run log. Look for the check-cyclic-dependencies job in the run.

@github-actions
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Container Widget Container widget Enhancement New feature or request Needs Design needs design or changes to design ok-to-test Required label for CI Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Stale Tab Widget Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Padding property for containers, tabs, forms,

1 participant