x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<span class="inline-block" data-controller="ui--popover"><button type="button" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 ring-offset-background disabled:pointer-events-none disabled:bg-muted! disabled:text-muted-foreground! border border-input bg-background hover:bg-accent hover:text-accent-foreground disabled:border-input! h-9 px-4 py-2 disabled:cursor-not-allowed" aria-busy="false" id="ui-popover-trigger-ui-popover-b727a558" aria-haspopup="true" aria-expanded="false" aria-controls="ui-popover-content-ui-popover-b727a558" data-ui--popover-target="trigger" data-action="click->ui--popover#toggle">Open Rich Popover</button> <div id="ui-popover-content-ui-popover-b727a558" class="z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2" role="dialog" aria-modal="false" aria-labelledby="ui-popover-title-ui-popover-b727a558" data-ui--popover-target="content" hidden="hidden" data-side="top" data-align="center" tabindex="-1"> <button type="button" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 ring-offset-background disabled:pointer-events-none disabled:text-muted-foreground! hover:bg-accent hover:text-accent-foreground disabled:bg-transparent! h-7 w-7 disabled:cursor-not-allowed absolute right-1 top-1" aria-label="Close" data-action="click->ui--popover#close"> <i data-lucide="x" class="inline-block shrink-0 w-4 h-4" aria-hidden="true"></i> </button> <h3 id="ui-popover-title-ui-popover-b727a558" class="font-semibold leading-none tracking-tight mb-2">User Profile</h3> <div class="flex items-center gap-3 mb-3"> <span class="relative flex shrink-0 overflow-hidden rounded-full h-10 w-10 text-sm bg-muted text-foreground/70" data-slot="avatar" fallback="JD"></span> <div> <p class="font-medium">John Doe</p> <p class="text-sm text-muted-foreground">john@example.com</p> </div> </div> <div class="flex gap-2"> <button type="button" class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 ring-offset-background disabled:pointer-events-none disabled:bg-muted! disabled:text-muted-foreground! bg-primary text-primary-foreground hover:bg-primary/90 h-8 rounded-md px-3 text-xs disabled:cursor-not-allowed" aria-busy="false">View Profile</button> <button type="button" class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 ring-offset-background disabled:pointer-events-none disabled:bg-muted! disabled:text-muted-foreground! border border-input bg-background hover:bg-accent hover:text-accent-foreground disabled:border-input! h-8 rounded-md px-3 text-xs disabled:cursor-not-allowed" aria-busy="false">Settings</button> </div> <div class="absolute size-2 rotate-45 bg-popover border-border data-[side=top]:border-r data-[side=top]:border-b data-[side=bottom]:border-l data-[side=bottom]:border-t data-[side=left]:border-t data-[side=left]:border-r data-[side=right]:border-b data-[side=right]:border-l" data-ui--popover-target="arrow" data-side="top"></div> </div></span>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%= render(UI::Popover.new) do |popover| %> <% popover.with_trigger { "Open Rich Popover" } %> <% popover.with_content(show_close: true) do |content| %> <% content.with_title { "User Profile" } %> <div class="flex items-center gap-3 mb-3"> <%= render(UI::Avatar.new(src: nil, fallback: "JD")) %> <div> <p class="font-medium">John Doe</p> <p class="text-sm text-muted-foreground">john@example.com</p> </div> </div> <div class="flex gap-2"> <%= render(UI::Button.new(size: :sm)) { "View Profile" } %> <%= render(UI::Button.new(variant: :outline, size: :sm)) { "Settings" } %> </div> <% end %><% end %>No notes provided.
No params configured.