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
<div class="h-screen overflow-hidden flex flex-col" data-controller="better-ui--drawer--layout" data-better-ui--drawer--layout-position-value="right" data-better-ui--drawer--layout-breakpoint-value="lg"> <header class="w-full h-16 bg-white border-b border-grayscale-200 text-grayscale-900 sticky top-0 flex items-center justify-between px-4 z-40" > <div class="flex items-center shrink-0"> <div class="lg:hidden flex items-center mr-2"> <button class="p-2 text-grayscale-600 hover:bg-grayscale-100 rounded-md lg:hidden" data-action="click->better-ui--drawer--layout#toggle"> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg> </button> </div> Right Sidebar Layout </div> </header> <div class="flex flex-1 overflow-hidden relative"> <div class="fixed inset-0 bg-black/50 z-40 hidden opacity-0 transition-opacity duration-300 lg:hidden" data-better-ui--drawer--layout-target="overlay" data-action="click->better-ui--drawer--layout#close"> </div> <div class="fixed inset-y-0 right-0 z-50 transform transition-transform duration-300 ease-in-out translate-x-full lg:hidden" data-better-ui--drawer--layout-target="sidebar"> <aside class="flex flex-col h-full w-64 bg-white text-grayscale-900 border-l border-grayscale-200 shrink-0" data-position="right" data-collapsible="true"> <div class="shrink-0 p-4 border-b border-grayscale-200"> Details </div> <div class="flex-1 overflow-y-auto p-4 space-y-6"> <div class="space-y-4"> <div> <div class="text-sm font-medium text-grayscale-500">Status</div> <div class="mt-1 text-success-600 font-medium">Active</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Created</div> <div class="mt-1">Dec 15, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Modified</div> <div class="mt-1">Dec 20, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Owner</div> <div class="mt-1 flex items-center"> <div class="w-6 h-6 bg-primary-500 rounded-full mr-2"></div> John Doe </div> </div> </div> </div> </aside> </div> <main class="flex-1 overflow-auto"> <div class="p-6"> <h1 class="text-2xl font-bold mb-4">Right Sidebar Layout</h1> <p class="text-grayscale-600">This layout has the sidebar positioned on the right side. Useful for detail panels, property inspectors, or contextual information.</p> </div> </main> <div class="hidden h-full lg:flex"> <aside class="flex flex-col h-full w-64 bg-white text-grayscale-900 border-l border-grayscale-200 shrink-0" data-position="right" data-collapsible="true"> <div class="shrink-0 p-4 border-b border-grayscale-200"> Details </div> <div class="flex-1 overflow-y-auto p-4 space-y-6"> <div class="space-y-4"> <div> <div class="text-sm font-medium text-grayscale-500">Status</div> <div class="mt-1 text-success-600 font-medium">Active</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Created</div> <div class="mt-1">Dec 15, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Modified</div> <div class="mt-1">Dec 20, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Owner</div> <div class="mt-1 flex items-center"> <div class="w-6 h-6 bg-primary-500 rounded-full mr-2"></div> John Doe </div> </div> </div> </div> </aside> </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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<%= render BetterUi::Drawer::LayoutComponent.new(sidebar_position: :right) do |layout| %> <% layout.with_header do |header| %> <% header.with_logo { "Right Sidebar Layout" } %> <% header.with_mobile_menu_button do %> <button class="p-2 text-grayscale-600 hover:bg-grayscale-100 rounded-md lg:hidden" data-action="click->better-ui--drawer--layout#toggle"> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg> </button> <% end %> <% end %> <% layout.with_sidebar(position: :right) do |sidebar| %> <% sidebar.with_header { "Details" } %> <% sidebar.with_navigation do %> <div class="space-y-4"> <div> <div class="text-sm font-medium text-grayscale-500">Status</div> <div class="mt-1 text-success-600 font-medium">Active</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Created</div> <div class="mt-1">Dec 15, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Modified</div> <div class="mt-1">Dec 20, 2024</div> </div> <div> <div class="text-sm font-medium text-grayscale-500">Owner</div> <div class="mt-1 flex items-center"> <div class="w-6 h-6 bg-primary-500 rounded-full mr-2"></div> John Doe </div> </div> </div> <% end %> <% end %> <% layout.with_main do %> <div class="p-6"> <h1 class="text-2xl font-bold mb-4">Right Sidebar Layout</h1> <p class="text-grayscale-600">This layout has the sidebar positioned on the right side. Useful for detail panels, property inspectors, or contextual information.</p> </div> <% end %><% end %>No notes provided.
No params configured.