Skip to content
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

[docs] Bordered popups and arrows #854

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Nov 22, 2024

There are various ways to create arrows, including bordered ones.

This demo uses CSS border and places Arrow inside Positioner instead of Popup. This is recommended as it prevents it from being cut off if Popup is scrollable.

The calculations to position the arrow correctly can get complex with small 1px or 2px differences, which the demo uses CSS variables for.

Floating UI has a rule that the layout box of the arrow should be a square with equal width and height, which this particular demo doesn't follow. However, the rule exists only for when the side axis flips from x to y or vice-versa, because the width or height of the arrow changing causes its position to be wrong on the very first update. However, this is rarely seen in practice when scrolling or resizing since more updates typically occur after the axis flip. Plus, given we likely don't want a popover or tooltip to flip its side axis when scrolling (which will be the case when #817 is merged), this won't be seen by default - if the side axis is only changed based on the available viewport width, it's unlikely for this to be seen in practice as well.

I also think we should make demos for SVG arrows.

@atomiks atomiks added the docs Improvements or additions to the documentation label Nov 22, 2024
@mui-bot
Copy link

mui-bot commented Nov 22, 2024

Netlify deploy preview

https://deploy-preview-854--base-ui.netlify.app/

Generated by 🚫 dangerJS against c99c92a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants