Previews

No matching results.

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
<div class="p-8 flex flex-col gap-8">
<div>
<p class="text-sm text-theme-6 mb-3">
Empty collection — empty state is derived from the action model:
</p>
<div data-controller="midwest-table" class="midwest-table-wrapper">
<div class="midwest-table-loading-overlay" aria-hidden="true">
<div class="midwest-loading-icon" role="img" aria-label="Loading" decorative="true">
<div class="midwest-loading-icon-inner">
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
<svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true">
<circle cx="15" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
<animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
<circle cx="105" cy="15" r="15">
<animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate>
<animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate>
</circle>
</svg>
</div>
</div>
</div>
<div class="midwest-table-scroll">
<table class="midwest-table">
<caption class="sr-only">Users</caption>
<thead class="midwest-table-head">
<tr>
<th scope="col" class="midwest-table-th align-start">
Name
</th>
<th scope="col" class="midwest-table-th align-start">
Email
</th>
<th scope="col" class="midwest-table-th align-start">
Role
</th>
</tr>
</thead>
<tbody class="midwest-table-body">
<tr>
<td colspan="3" class="midwest-table-empty-cell">
<div class="midwest-empty-state variant-inline">
<div class="empty-state-inner">
<div class="empty-state-icon">
<div class="midwest-icon ">
<div class="midwest-icon-inner">
<svg xmlns="http://www.w3.org/2000/svg" class="Midwest-Icon__Svg" viewbox="0 0 512 512" focusable="false" role="img" aria-label="Person"><title>Person</title>
<path d="M332.64 64.58C313.18 43.57 286 32 256 32c-30.16 0-57.43 11.5-76.8 32.38-19.58 21.11-29.12 49.8-26.88 80.78C156.76 206.28 203.27 256 256 256s99.16-49.71 103.67-110.82c2.27-30.7-7.33-59.33-27.03-80.6zM432 480H80a31 31 0 01-24.2-11.13c-6.5-7.77-9.12-18.38-7.18-29.11C57.06 392.94 83.4 353.61 124.8 326c36.78-24.51 83.37-38 131.2-38s94.42 13.5 131.2 38c41.4 27.6 67.74 66.93 76.18 113.75 1.94 10.73-.68 21.34-7.18 29.11A31 31 0 01432 480z"></path></svg>
</div>
</div>
</div>
<div class="empty-state-content">
<p class="empty-state-title">No Users</p>
<div data-controller="midwest-prose" class="midwest-prose prose">
<p>No users have been added yet.</p>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</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
23
24
<%
# A model stub that includes Midwest::Iconable so the empty state auto-populates
# the icon, title, and body text.
user_model = Class.new do
include Midwest::Iconable
icon :person
def self.model_name
Struct.new(:human, keyword_init: true).new(human: 'User')
end
end
%>
<div class="p-8 flex flex-col gap-8">
<div>
<p class="text-sm text-theme-6 mb-3">
Empty collection — empty state is derived from the action model:
</p>
<%= midwest_table(collection: [], action_model: user_model, caption: 'Users') do |t| %>
<% t.with_column('Name', key: :name) %>
<% t.with_column('Email', key: :email) %>
<% t.with_column('Role', key: :role) %>
<% end %>
</div>
</div>

No assets to display.
Add a .js or .css file alongside the component to see it here.

Accessibility

Figma embed for Table/with_action_model

Annotate a preview to embed its Figma design here:

@figma "https://figma.com/..."