shadcn.io is not affiliated with official shadcn/ui
Phone Frame Carousel Gallery Block for React
Five app screens drawn in phone frames in a ruled band, the chosen one centred at full strength with its neighbours peeking in veiled, steered by a row of five feature tabs under a compact header.
Installation
Overview
A phone-frame carousel for React with Base UI, for Pennymoor, a money-tracking app. A compact header holds a row of five feature names, Activity, Spending, Quick add, Places and Ask, and under it a ruled band with + marks holds one row of five phone frames. The chosen screen is centred at full strength and the others peek in from both sides under a veil, cut off by the band's edges, so it is clear there is more. Each screen is drawn in code (a transaction list, a spending chart, an add form, a street map with pins and a chat), in your theme's greys, with no photograph and no real device. The text under the phones is the chosen tab's panel: a heading and a sentence, so every screen has a written description. The row slides with a CSS transition. Built from Tabs and Guides; the screens are plain boxes you replace with your own. The app, its figures and the places are made up for the example.
FAQ
How do I use my own screens?
Each entry in SCREENS has an id, a tab label, a heading and a sentence, and ScreenFor returns the drawing for an id. Replace a drawing with an img or a live component inside the phone's screen box, and keep the sentence: it is the description screen readers get. Add or remove entries and the row, the tabs and the panels follow; the shift classes in AT need one entry per screen.
How is the chosen screen centred?
The row is as wide as the band and every phone has the same width, so the shift is a single CSS calculation: half the band, minus half a phone, minus the number of phones before the chosen one times a phone and a gap. There is no measuring and no script on resize. The neighbours are the same size, veiled by a layer in your background colour.
How does it work with a keyboard?
The tabs are the control: Tab reaches the list, the arrow keys move between the five names, and Home and End go to the first and last, so the chosen screen follows. The peeking phones can also be clicked or tapped, but they are not in the tab order, since the tabs already do the same job. The phones themselves are hidden from screen readers; the panel under them is what is read. Choosing a tab with the arrow keys selects it, so the row slides as you go.
Does it swipe on a phone?
Yes. A swipe of about 40 pixels or more moves to the next or previous screen (the other way in a right-to-left page), and the tabs above scroll sideways when they do not fit. Vertical scrolling still passes through the band.
Related
- Pro
Carousel Gallery
Carousels and slidesNine drawn trail pictures in a ruled band for a trail-guide app, three wide with the next one cut off at the rail, turned with buttons, dots and the arrow keys, under a heading row with a live counter.
- Pro
Scrolling Screenshot Gallery
Stage and thumbnailsA tall landing page drawn in code and shown in a fixed-height browser window that a Scroll preview button plays down, a slider scrubs and an index of five sections jumps.
- Pro
Product Tour Gallery
Stage and thumbnailsOne drawn checkout-builder screen framed beside three feature rows, with a Take the tour button that runs a four-step Tour: popovers anchored to regions of the screen, each spotlit.
- Pro
Coverflow Gallery
Carousels and slidesEight drawn album sleeves in a framed stage with the middle one full size and square and its neighbours turned away and dimmed, moved by buttons, arrow keys or a click, with the title band that closes the frame.
- Pro
Card Carousel Features
Carousels and mediaA multi-up carousel of seven capability cards for a product-tour builder, each led by a greyscale drawing, with the next card cut off at the rail and previous and next buttons in the heading row.
- Pro
Annotated Mockup Pin Tooltips Features
App screensA shipping-ops console drawn in greyscale with six numbered pins that open a popover on click, tap or Enter, and a legend of six rows in shared hairlines that opens the same popovers.