MediaBefore and After Compare Slider
Two stacked local SVG pictures with a range input that moves a divider between them, and the split read out as a percentage.
Ready-to-use HTML, CSS and JavaScript with a live preview. Copy the code or open any snippet in the playground.
17 snippets · page 2 of 2
MediaTwo stacked local SVG pictures with a range input that moves a divider between them, and the split read out as a percentage.
FeedbackA hint on hover and keyboard focus and a click-to-open popover built on the native popover attribute, with Escape to close either.
ButtonsA segmented radio control, joined buttons, icon-only buttons with accessible names and a split button whose menu is a native popover.
UtilitiesButtons that copy a line of code, say so for three seconds in a live region, and select the text for a keyboard copy when the clipboard is missing.
NavigationA menu button that opens a list of actions, with arrow keys, Home, End, type-ahead, Escape and a click outside, written without a library.
Try our online code playground to experiment with these snippets and create your own projects.