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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<div class="p-8 space-y-6">
<h3 class="text-lg font-semibold mb-4">Default Pagination</h3>
<nav aria-label="Pagination" class="flex flex-col items-center">
<ul role="list" class="flex items-center gap-1.5">
<li>
<a href="#page-4" rel="prev" aria-label="Previous page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
</svg>
</a>
</li>
<li>
<a href="#page-1" aria-label="Go to page 1" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">1</a>
</li>
<li>
<a href="#page-2" aria-label="Go to page 2" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">2</a>
</li>
<li>
<a href="#page-3" aria-label="Go to page 3" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">3</a>
</li>
<li>
<a href="#page-4" aria-label="Go to page 4" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">4</a>
</li>
<li>
<span aria-current="page" aria-label="Page 5" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-primary-600 bg-primary-50 text-primary-700">5</span>
</li>
<li>
<a href="#page-6" aria-label="Go to page 6" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">6</a>
</li>
<li>
<a href="#page-7" aria-label="Go to page 7" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">7</a>
</li>
<li>
<span aria-hidden="true" class="inline-flex items-center justify-center min-w-9 h-9 text-sm px-3 text-grayscale-400 select-none"></span>
</li>
<li>
<a href="#page-20" aria-label="Go to page 20" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">20</a>
</li>
<li>
<a href="#page-6" rel="next" aria-label="Next page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
</svg>
</a>
</li>
</ul>
</nav>
<h3 class="text-lg font-semibold mb-4 mt-8">With First/Last Buttons</h3>
<nav aria-label="Pagination" class="flex flex-col items-center">
<ul role="list" class="flex items-center gap-1.5">
<li>
<a href="#page-1" aria-label="First page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M15.79 14.77a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L11.832 10l3.938 3.71a.75.75 0 01.02 1.06zm-6 0a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L5.832 10l3.938 3.71a.75.75 0 01.02 1.06z" clip-rule="evenodd" />
</svg>
</a>
</li>
<li>
<a href="#page-9" rel="prev" aria-label="Previous page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
</svg>
</a>
</li>
<li>
<a href="#page-1" aria-label="Go to page 1" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">1</a>
</li>
<li>
<span aria-hidden="true" class="inline-flex items-center justify-center min-w-9 h-9 text-sm px-3 text-grayscale-400 select-none"></span>
</li>
<li>
<a href="#page-8" aria-label="Go to page 8" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">8</a>
</li>
<li>
<a href="#page-9" aria-label="Go to page 9" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">9</a>
</li>
<li>
<span aria-current="page" aria-label="Page 10" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-primary-600 bg-primary-50 text-primary-700">10</span>
</li>
<li>
<a href="#page-11" aria-label="Go to page 11" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">11</a>
</li>
<li>
<a href="#page-12" aria-label="Go to page 12" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">12</a>
</li>
<li>
<span aria-hidden="true" class="inline-flex items-center justify-center min-w-9 h-9 text-sm px-3 text-grayscale-400 select-none"></span>
</li>
<li>
<a href="#page-20" aria-label="Go to page 20" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">20</a>
</li>
<li>
<a href="#page-11" rel="next" aria-label="Next page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
</svg>
</a>
</li>
<li>
<a href="#page-20" aria-label="Last page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" aria-hidden="true">
<path fill-rule="evenodd" d="M10.21 14.77a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L6.832 10l3.938 3.71a.75.75 0 01.02 1.06zm6 0a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L12.832 10l3.938 3.71a.75.75 0 01.02 1.06z" clip-rule="evenodd" />
</svg>
</a>
</li>
</ul>
</nav>
<h3 class="text-lg font-semibold mb-4 mt-8">With Custom Labels</h3>
<nav aria-label="Pagination" class="flex flex-col items-center">
<ul role="list" class="flex items-center gap-1.5">
<li>
<a href="#page-1" aria-label="First page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
First
</a>
</li>
<li>
<a href="#page-4" rel="prev" aria-label="Previous page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
Prev
</a>
</li>
<li>
<a href="#page-1" aria-label="Go to page 1" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">1</a>
</li>
<li>
<a href="#page-2" aria-label="Go to page 2" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">2</a>
</li>
<li>
<a href="#page-3" aria-label="Go to page 3" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">3</a>
</li>
<li>
<a href="#page-4" aria-label="Go to page 4" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">4</a>
</li>
<li>
<span aria-current="page" aria-label="Page 5" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-primary-600 bg-primary-50 text-primary-700">5</span>
</li>
<li>
<a href="#page-6" aria-label="Go to page 6" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">6</a>
</li>
<li>
<a href="#page-7" aria-label="Go to page 7" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">7</a>
</li>
<li>
<span aria-hidden="true" class="inline-flex items-center justify-center min-w-9 h-9 text-sm px-3 text-grayscale-400 select-none"></span>
</li>
<li>
<a href="#page-20" aria-label="Go to page 20" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">20</a>
</li>
<li>
<a href="#page-6" rel="next" aria-label="Next page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
Next
</a>
</li>
<li>
<a href="#page-20" aria-label="Last page" class="inline-flex items-center justify-center font-medium transition-colors duration-200 min-w-9 h-9 text-sm px-3 rounded-md border border-grayscale-200 text-grayscale-700 hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700">
Last
</a>
</li>
</ul>
</nav>
</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
25
26
27
28
<div class="p-8 space-y-6">
<h3 class="text-lg font-semibold mb-4">Default Pagination</h3>
<%= render BetterUi::Pagination::PaginationComponent.new(
current_page: 5,
total_pages: 20,
url: ->(page) { "#page-#{page}" }
) %>
<h3 class="text-lg font-semibold mb-4 mt-8">With First/Last Buttons</h3>
<%= render BetterUi::Pagination::PaginationComponent.new(
current_page: 10,
total_pages: 20,
url: ->(page) { "#page-#{page}" },
show_first_last: true
) %>
<h3 class="text-lg font-semibold mb-4 mt-8">With Custom Labels</h3>
<%= render BetterUi::Pagination::PaginationComponent.new(
current_page: 5,
total_pages: 20,
url: ->(page) { "#page-#{page}" },
show_first_last: true,
first_label: "First",
last_label: "Last",
prev_label: "Prev",
next_label: "Next"
) %>
</div>