
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
card-layouts
Advanced tools
card-layouts is a library for generating JavaScript-based card layouts.
npm install card-layouts
card-layouts library supports 3 layout modes
import rows from 'card-layouts'
const objects =
const result = rows({
items: [
{width: 10, height: 10},
{width: 20, height: 10},
{width: 10, height: 20},
],
width: 100,
})
will return
[
{width: 10, height, 10, x: 0, y: 0},
{width: 20, height, 10, x: 10, y: 0},
{width: 5, height, 10, x: 30, y: 0},
]
default: []
type: Array
Items to be laid out. Each item is expected to have x, y, width, height
properties.
default: 0
type: Integer
The gap between the cards
default: undefined
type: Integer
The width of the area to fill with cards.
default: undefined
type: Integer
The number of the columns. If there's no number - width and size parameters
are used to determine the number of the columns.
default: undefined
type: Object
The object that determines card size: {width: 100, height: 100}.
default: undefined
type: Integer
Row height for each of the rows generated.
default: undefined
type: Integer
The number of the columns. If there's no number - width and size parameters
are used to determine the number of the columns.
MIT
FAQs
A simple library for different card layout strategies
We found that card-layouts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.