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
<div class="p-8"> <h3 class="text-lg font-semibold mb-4">With Dividers and Section Headers</h3> <div class="relative inline-block" data-controller="better-ui--dropdown--dropdown" data-better-ui--dropdown--dropdown-auto-close-value="true" data-better-ui--dropdown--dropdown-close-on-item-click-value="true"> <div aria-haspopup="true" aria-expanded="false" data-action="click->better-ui--dropdown--dropdown#toggle" data-better-ui--dropdown--dropdown-target="trigger"> <button type="button" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary-500 bg-transparent border-2 border-secondary-600 hover:border-secondary-700 hover:bg-secondary-50 text-secondary-600 px-4 py-2 text-base gap-2 cursor-pointer"> <span data-better-ui--button-target="spinner" class="hidden"> <svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> <span class="sr-only">Loading...</span> </span> <span data-better-ui--button-target="content" class=" inline-flex items-center gap-2"> Account Menu </span> </button> </div> <div role="menu" hidden data-better-ui--dropdown--dropdown-target="menu" class="absolute z-50 bg-white rounded-md ring-1 ring-grayscale-200 ring-opacity-5 py-1 overflow-hidden focus:outline-none transition-all duration-150 ease-out opacity-0 scale-95 w-72 top-full left-0 mt-1 shadow-lg"> <div role="presentation" class="px-3 py-2 text-xs font-semibold uppercase tracking-wider text-grayscale-500"> Account </div> <a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#profile"> <span class="flex-1">My Profile</span> </a> <a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#settings"> <span class="flex-1">Settings</span> </a> <div role="separator" class="border-t border-grayscale-200 my-1"></div> <div role="presentation" class="px-3 py-2 text-xs font-semibold uppercase tracking-wider text-grayscale-500"> Team </div> <a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#members"> <span class="flex-1">Members</span> </a> <a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#billing"> <span class="flex-1">Billing</span> </a> <div role="separator" class="border-t border-grayscale-200 my-1"></div> <a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-danger-600 hover:bg-danger-50 hover:text-danger-700 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#logout"> <span class="flex-1">Sign Out</span> </a> </div> </div></div>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div class="p-8"> <h3 class="text-lg font-semibold mb-4">With Dividers and Section Headers</h3> <%= render BetterUi::Dropdown::DropdownComponent.new(size: :lg) do |d| %> <% d.with_trigger do %> <%= render(BetterUi::ButtonComponent.new(variant: :secondary, style: :outline)) do %>Account Menu<% end %> <% end %> <% d.with_header(text: "Account") %> <% d.with_item(href: "#profile") { "My Profile" } %> <% d.with_item(href: "#settings") { "Settings" } %> <% d.with_divider %> <% d.with_header(text: "Team") %> <% d.with_item(href: "#members") { "Members" } %> <% d.with_item(href: "#billing") { "Billing" } %> <% d.with_divider %> <% d.with_item(href: "#logout", variant: :danger) { "Sign Out" } %> <% end %></div>No notes provided.
No params configured.