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
<div class="h-screen overflow-hidden flex flex-col" data-controller="better-ui--drawer--layout" data-better-ui--drawer--layout-position-value="left" data-better-ui--drawer--layout-breakpoint-value="lg">
<header class="w-full h-16 bg-primary-600 border-b border-primary-700 text-white 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-white hover:bg-white/10 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>
<div class="flex items-center">
<div class="w-8 h-8 bg-white/20 rounded-lg flex items-center justify-center text-white font-bold">B</div>
<span class="ml-2 font-semibold text-lg">Primary Theme</span>
</div>
</div>
<div class="flex items-center gap-2">
<div class="w-8 h-8 bg-white/20 rounded-full"></div>
</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="hidden h-full lg:flex">
<aside class="flex flex-col h-full w-64 bg-primary-800 text-white border-r border-primary-900 shrink-0" data-position="left" data-collapsible="true">
<div class="flex-1 overflow-y-auto p-4 space-y-6">
<nav class="space-y-1">
<a href="#" class="flex items-center px-4 py-2 rounded-md bg-white/20 text-white">Dashboard</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Projects</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Team</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Settings</a>
</nav>
</div>
</aside>
</div>
<div class="fixed inset-y-0 left-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-primary-800 text-white border-r border-primary-900 shrink-0" data-position="left" data-collapsible="true">
<div class="flex-1 overflow-y-auto p-4 space-y-6">
<nav class="space-y-1">
<a href="#" class="flex items-center px-4 py-2 rounded-md bg-white/20 text-white">Dashboard</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Projects</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Team</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Settings</a>
</nav>
</div>
</aside>
</div>
<main class="flex-1 overflow-auto">
<div class="p-6">
<h1 class="text-2xl font-bold mb-4">Primary Theme Layout</h1>
<p class="text-grayscale-600">This demonstrates a primary-colored drawer layout. The header uses the primary variant and the sidebar uses the primary variant as well.</p>
</div>
</main>
</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
<%= render BetterUi::Drawer::LayoutComponent.new do |layout| %>
<% layout.with_header(variant: :primary) do |header| %>
<% header.with_mobile_menu_button do %>
<button class="p-2 text-white hover:bg-white/10 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 %>
<% header.with_logo do %>
<div class="flex items-center">
<div class="w-8 h-8 bg-white/20 rounded-lg flex items-center justify-center text-white font-bold">B</div>
<span class="ml-2 font-semibold text-lg">Primary Theme</span>
</div>
<% end %>
<% header.with_actions do %>
<div class="w-8 h-8 bg-white/20 rounded-full"></div>
<% end %>
<% end %>
<% layout.with_sidebar(variant: :primary) do |sidebar| %>
<% sidebar.with_navigation do %>
<nav class="space-y-1">
<a href="#" class="flex items-center px-4 py-2 rounded-md bg-white/20 text-white">Dashboard</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Projects</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Team</a>
<a href="#" class="flex items-center px-4 py-2 rounded-md hover:bg-white/10 text-primary-100">Settings</a>
</nav>
<% end %>
<% end %>
<% layout.with_main do %>
<div class="p-6">
<h1 class="text-2xl font-bold mb-4">Primary Theme Layout</h1>
<p class="text-grayscale-600">This demonstrates a primary-colored drawer layout. The header uses the primary variant and the sidebar uses the primary variant as well.</p>
</div>
<% end %>
<% end %>