shadcn.io is not affiliated with official shadcn/ui
Product Dimensions Storefront Block for Radix UI
A dimensioned drawing of a duffel with cm or in labels, a Product or Package view with the weight, and a Will it fit check that compares a space you type against each axis.
Installation
Overview
Answer the shopper's first luggage question, whether it will fit, with this dimensions panel for React with Radix UI. A header says what Saltash, a luggage shop, sells and holds a Segment Group for cm or in. In a hairline frame with a plus mark on each corner, the first cell draws the duffel with its width, height and depth lines labelled in the chosen unit, under a Product or Package switch and the weight (kg or lb). The side cell asks Will it fit: type the width, depth and height of a space in Input fields and each axis says how much is to spare or how far over the bag is, with one sentence for the result, such as Fits with 2 cm to spare or Too wide by 4 cm. Switching to Package redraws the bag larger and changes every number together, and typed values convert when the unit changes. It's built from Segment Group, Input, Field and Guides, with a drawn product and a CSS entrance only. For a luggage or furniture product page, a shipping box guide or a carry-on checker.
FAQ
How do I fill it with my own product?
Edit DIMS: a product and a package entry, each with a width, depth and height in centimetres and a weight in grams. The drawing is sized from those numbers, so a deeper or taller product is drawn deeper or taller.
How is the check worked out?
Each axis of the space is compared with the same axis of the bag, with no rotation: spare room is the space minus the bag. If every axis is zero or more, the answer is the smallest spare room; otherwise it names the axis that is over by the most. Every axis is also listed under the fields.
Are the converted numbers exact?
They are rounded to one decimal. The check is always worked out in centimetres, so the answer does not change with the unit, only the way it is written.
What stays local, and how do I wire it to real data?
The sizes and the space are samples and nothing is sent. To use real data, load your product's dimensions into DIMS. To check a stored space, such as a locker or a cabin allowance, set the initial space from it.