x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<div class="flex flex-col gap-6"> <div> <p class="text-sm text-gray-11 px-1 mb-2">Numeric gap (shorthand) — <code>gap: 1</code> resolves to <code>1rem</code></p> <div class="midwest-grid" style="--grid-width: 160px; --grid-gap: 1rem"> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 1</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 2</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 3</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 4</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 5</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 6</p> </section> </div> </article> </div> </div> <div> <p class="text-sm text-gray-11 px-1 mb-2">String gap via <code>column_gap:</code> — pass any CSS value directly, e.g. <code>"4px"</code></p> <div class="midwest-grid" style="--grid-width: 160px; --grid-gap: 4px"> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 1</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 2</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 3</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 4</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 5</p> </section> </div> </article> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <section> <p class="font-bold text-center">Item 6</p> </section> </div> </article> </div> </div></div>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="flex flex-col gap-6"> <div> <p class="text-sm text-gray-11 px-1 mb-2">Numeric gap (shorthand) — <code>gap: 1</code> resolves to <code>1rem</code></p> <%= midwest_grid(width: 160, gap: 1) do %> <% 6.times do |i| %> <%= midwest_card do %> <p class="font-bold text-center">Item <%= i + 1 %></p> <% end %> <% end %> <% end %> </div> <div> <p class="text-sm text-gray-11 px-1 mb-2">String gap via <code>column_gap:</code> — pass any CSS value directly, e.g. <code>"4px"</code></p> <%= midwest_grid(width: 160, column_gap: "4px") do %> <% 6.times do |i| %> <%= midwest_card do %> <p class="font-bold text-center">Item <%= i + 1 %></p> <% end %> <% end %> <% end %> </div></div>Column gap
column_gap: accepts any CSS string value (e.g. "4px", "0.5rem"),
while the shorthand gap: takes a number and appends rem.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Grid/column_gap
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."