Masonry Shuffle
ProInstallation
ProMasonry Shuffle is a Pro component
Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.
Install with a key
- Add the Pro registry to
components.json:components.json { "registries": { "@uibrik-pro": { "url": "https://uibrik.com/r/pro/{name}.json", "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" } } } } - Put your key in
.env.localand add that file to.gitignore:.env.local UIBRIK_LICENSE=your-license-key - Install it:
Terminal npx shadcn@latest add @uibrik-pro/masonry-shuffle
Loading your installation…
Props
MasonryShuffle- rowHeight
- Type number
- 170
- Height a row aims for. Rows land a little under it so they fill the width exactly.
- gap
- Type number
- 10
- Space between tiles.
- radius
- Type number
- 14
- Corner radius of a tile.
- duration
- Type number
- 0.6
- How long a move takes.
- bounce
- Type number
- 0.12
- Springiness of a move. 0 settles without overshoot.
- toolbar
- Type boolean
- true
- Show Shuffle, Add and Reset above the grid.
- expandable
- Type boolean
- true
- Enlarge a photo in the centre of its row when pressed, with its neighbours fitted around it.
- removable
- Type boolean
- true
- Show a remove button on each tile.
- items
- Type { id: string; src: string; alt: string; width: number; height: number }[]
- SAMPLE_ITEMS
- Photos in order. width and height set the aspect ratio.
- initialCount
- Type number
- items.length - 4
- How many photos show at first; Add brings in the rest.
- onChange
- Type (items) => void
- –
- Called with the shown photos in their new order after every change.
- className
- Type string
- –
- Classes for the wrapper.