Skip to content

Conversation

Abdalqader27
Copy link
Contributor

@Abdalqader27 Abdalqader27 commented May 29, 2025

Description

Introduced the StacVisibility widget, which allows conditional rendering of its child based on a visible property. It also supports maintain properties and a replacement widget.

Examples

  • ✅ Example 1: Using Visibility.maintain
{
  "type": "visibility",
  "visible": false,
  "maintainState": true,
  "maintainAnimation": true,
  "maintainSize": true,
  "maintainSemantics": true,
  "maintainInteractivity": true,
  "child": {
    "type": "text",
    "data": "I'm hidden but still take space"
  }
}
  • ✅ Example 2: Standard Visibility with replacement
{
  "type": "visibility",
  "visible": false,
  "maintainState": false,
  "maintainAnimation": false,
  "maintainSize": false,
  "maintainSemantics": false,
  "maintainInteractivity": false,
  "child": {
    "type": "text",
    "data": "I'm not visible"
  },
  "replacement": {
      "type": "text",
      "data": "I replace the hidden widget"
  }
}
  • ✅ Example 3: Default visible: true
{
  "type": "visibility",
  "child": {
    "type": "text",
    "data": "I'm visible"
  }
}

Related Issues

Closes #263

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

@divyanshub024
Copy link
Member

divyanshub024 commented May 29, 2025

Hey @Abdalqader27 !! Thanks for this PR. Can you please add documentation as well, it's under the website/docs folder?

@Abdalqader27
Copy link
Contributor Author

Hey @Abdalqader27 !! Thanks for this PR. Can you please add documentation as well, it's under the website/docs folder?

Hey @divyanshub024, I noticed the file here:
https://github.com/StacDev/stac/blob/dev/website/docs/widgets/visibility.md

Would you like me to add more examples to this, or is it sufficient as is?

@divyanshub024
Copy link
Member

Ohh, I didn't notice we already had a doc. We are good.

Copy link
Member

@divyanshub024 divyanshub024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the Pr @Abdalqader27 👍🏻
There are few small suggestiong, please check it out.

Copy link
Member

@divyanshub024 divyanshub024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @Abdalqader27 🎉 💯

@divyanshub024 divyanshub024 merged commit 520a0a2 into StacDev:dev May 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add support for the visibility widget

2 participants