Skip to the content

Radial slider

A slider on a wheel. The cards sit on the rim of a great wheel that lies flat, facing the page, its hub far under the foot of the section: what shows is the top of the rim, an arc of cards that lean, sink and fade to each side.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    Give the cards a width: the whole wheel is built from the box of a card. Leave the section room under the card at the top, where the side cards sink, and set no transform or opacity on the cards themselves: the script writes both.
  3. Add custom JS

  4. Tune it

    Custom attributes
    Select the section on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-radial-slider Marks the section that holds the wheel. It takes no value: leave the value field empty. That section is what the engine mounts on, what carries the settings and the states, what cuts the cards that sink past its edges, and what it looks for the wheel, the counter, the caption box and the buttons in. Without it on any section of the page, the embed marks the section holding each wheel (data-radial-slider-wheel).
    data-radial-slider-wheel Marks the box that holds the cards, the top of the rim. Without it the parent of the first marked card is taken; with neither, nothing is mounted and the console says so. [ Required ]
    data-radial-slider-card Marks one card, a child of the wheel. Two at least, and as many as you like: the wheel is endless when they cover its arc and one card more, ten with the defaults, and keeps two ends with fewer. Without it on any of them the engine takes the wheel's own children as the cards. [ Optional ]
    data-radial-slider-stage Marks the box the hand grabs, which also takes the mouse wheel and the keyboard focus. Without it the parent of the wheel is taken. [ Optional ]
    data-radial-slider-caption Marks the caption of a card, inside it. With the script it is hidden in the card and shown in the display box when the card is at the top. Without it the alt of the card's picture is used. [ Optional ]
    data-radial-slider-display Marks the box that shows the caption of the card at the top, which comes out of a mask at each change. Without it no caption is shown. [ Optional ]
    data-radial-slider-current Marks the number of the card at the top. The engine fills it with a reel that rolls as the wheel turns. Without it there is no current number. [ Optional ]
    data-radial-slider-total Marks the total of the counter, which the engine writes as the card count. Without it there is no total. [ Optional ]
    data-radial-slider-prev Marks a button that steps the wheel one card back. Without it the drag, the mouse wheel and the arrow keys still do. [ Optional ]
    data-radial-slider-next Marks a button that steps the wheel one card further. Without it the drag, the mouse wheel and the arrow keys still do. [ Optional ]
    data-radial-slider-state Written by the engine on the section: ready, or still under reduced motion. Never written by hand; the stylesheet reads it to pile the cards at the top of the wheel, cut the section and show the hand. [ Optional ]
    data-radial-slider-dragging Written by the engine on the section while a drag runs. Never written by hand; the stylesheet reads it for the closed hand. [ Optional ]
    data-radial-slider-endless Written by the engine on the section while the wheel goes round without end, and absent while it has a first and a last card. Never written by hand; a rule of the page may read it. [ Optional ]
    data-radial-slider-active Written by the engine on the card at the top. Never written by hand; a rule of the page may read it. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same section. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-radial-slider-color #f4ece0 Colour of the current number of the counter and of the caption, the cream in the dark look. Options: any CSS colour; without the setting, --radial-slider-color on the section takes over.
    data-radial-slider-radius 6 Radius of the wheel, from its hub to the middle of a card, in card widths.
    data-radial-slider-gap 0.1 Space left between two cards where they are closest, at their feet, as a share of the card width.
    data-radial-slider-arc 50 Half opening of the arc the cards show on, in degrees from the top; a card reaching it is taken out.
    data-radial-slider-fade 1 How far a card has faded when it reaches the end of the arc, 0 to 1; it fades as the square of its way there.
    data-radial-slider-loop 1 Whether the wheel is endless when its cards cover the arc and one card more. Options: 1 lets it go round without end when the cards allow it; 0 always keeps a first and a last card, with a soft stop at each.
    data-radial-slider-friction 0.965 Share of its speed a spinning wheel keeps from one frame to the next, at 60 frames a second.
    data-radial-slider-snap 140 Stiffness of the spring that docks a card and that steps the wheel from the keys, the buttons and a click.
    data-radial-slider-autoplay 0 Time between two cards when the wheel turns by itself, in seconds.

What it does

Radial slider is a scroll animation for Webflow and vanilla JavaScript, with no library. Also called radial cards slider, circular carousel or arc slider.

A slider on a wheel. The cards sit on the rim of a great wheel that lies flat, facing the page, its hub far under the foot of the section: what shows is the top of the rim, an arc of cards that lean, sink and fade to each side. The hand grabs the wheel, with the mouse or a finger, and throws it: the wheel runs on with the speed it was given, loses it to friction with no notch as the cards go by, and docks on a card, a soft spring taking it for the last degrees. Over the wheel, the number of the card at the top rolls on a reel geared to it, and its caption comes out of a mask as the card comes in. A mouse wheel pushes it, the arrow keys and two buttons step it card by card, and a click on a card that is not at the top brings it there. The engine counts the cards of the markup: the wheel is endless when they cover its arc, and keeps two soft ends when they do not. Under reduced motion the wheel stands still and every input steps one card at once. No library: Pointer Events and one rotation per card, on a clock that sleeps at rest. Pattern type radial slider, circular carousel, arc slider, wheel carousel.

Updated

Questions

Mark three levels with custom attributes: data-radial-slider on the section, data-radial-slider-wheel on the box that holds the cards, and data-radial-slider-card on each card. Settings go on the section, for instance data-radial-slider-radius="8" for a shallower arc.

Enough to cover the visible arc and one card more: ten with the default settings and the cards of the preview. The engine counts the cards of the markup and works it out itself; with fewer, the wheel keeps a first and a last card with a soft stop at each. To loop a short row, lower data-radial-slider-arc rather than duplicating cards.

No, it loads no library. The drag is read through Pointer Events as an angle round the hub of the wheel, and each card gets one rotation per frame, on a clock that sleeps at rest. The momentum after a throw and the spring that docks a card are computed by the engine.

With data-radial-slider-radius, the radius of the wheel in card widths, 6 by default. A lower value gives a tight arc whose side cards lean and sink fast, a higher one a shallow arc close to a straight row. The wheel is sized from the card, so a fluid card width keeps the same curve at every screen size.

No. The stage has touch-action: pan-y, so a vertical swipe scrolls the page and a sideways one turns the wheel. A plain vertical mouse wheel is also left to the page whenever the page has somewhere to scroll, and the arrow keys step the wheel one card at a time.