base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[docs] Inset slider experiments

Open mj12albert opened this issue 9 months ago • 3 comments

Relates to https://github.com/mui/base-ui/issues/1530

Demo: https://deploy-preview-1609--base-ui.netlify.app/experiments/slider/inset

Update: after https://github.com/mui/base-ui/pull/1661 pseudo-elements are no longer necessary for functionality, one is needed to visually extend the indicator a bit

~~It's possible with the current API though a bit tricky:~~

  • ~~Put Control inside Track, instead of track inside control as documented; this doesn't affect any functionality since track is just a plain div~~

  • ~~Add semi-circular pseudo-elements to Control to extend the hitbox~~

  • ~~Add semi-circular pseudo-elements to the Track so borders can wrap around them~~

  • ~~To put a border around the whole thing, use box-shadow to apply top/bottom borders to the track, and borders around 3 sides of the Tracks pseudo-elements~~

  • [x] I have followed (at least) the PR section of the contributing guide.

mj12albert avatar Mar 27 '25 15:03 mj12albert

Deploy Preview for base-ui ready!

Name Link
Latest commit 5fdb718e6c399d1998af961e5b89444eef28ee6a
Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68491b01d8268f0008d7f1d6
Deploy Preview https://deploy-preview-1609--base-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Mar 27 '25 15:03 netlify[bot]

Screenshot 2025-03-28 at 4 19 20 PM

The trickiest part was getting rid of these overlapping pixels when the colors have transparency, needed to use clip-path for this

mj12albert avatar Mar 28 '25 08:03 mj12albert

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@1609

commit: 5fdb718

pkg-pr-new[bot] avatar May 16 '25 14:05 pkg-pr-new[bot]

I think this is good to merge to the experiments, the only issue is at certain extreme zoom levels, the gap between pseudo-elements can be visible:

Image 20-5-2025 at 3 40 PM

mj12albert avatar May 20 '25 07:05 mj12albert

Bundle size report

Total Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%) Files: 41 total (0 added, 0 removed, 0 changed)

Show details for 41 more bundles

@base-ui-components/reactparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/accordionparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/alert-dialogparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/avatarparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/checkboxparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/checkbox-groupparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/collapsibleparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/context-menuparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/dialogparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/direction-providerparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/fieldparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/fieldsetparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/formparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/inputparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/menuparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/menubarparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/merge-propsparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/meterparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/navigation-menuparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/number-fieldparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/popoverparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/preview-cardparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/progressparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/radioparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/radio-groupparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/scroll-areaparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/selectparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/separatorparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/sliderparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/switchparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/tabsparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toastparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toggleparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toggle-groupparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toolbarparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/tooltipparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/unstable-no-ssrparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/unstable-use-media-queryparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/use-renderparsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/utilsparsed: 0B(0.00%) gzip: 0B(0.00%) Base UI checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 5fdb718e6c399d1998af961e5b89444eef28ee6a

mui-bot avatar Jun 11 '25 05:06 mui-bot