<div class="flex items-center gap-4"> <button class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-xs transition-colors hover:bg-primary/90" onclick="this.parentElement.querySelector('dialog').dispatchEvent(new Event('phx-shadcn:show'))">Open Dialog</button> <.dialog id="dialog-single-default" on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")} > <.dialog_header> <.dialog_title id="dialog-default-title">Are you absolutely sure?</.dialog_title> <.dialog_description id="dialog-default-description"> This action cannot be undone. This will permanently delete your account and remove your data from our servers. </.dialog_description> </.dialog_header> <.dialog_footer> <.dialog_close on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")}> <.button variant="outline">Cancel</.button> </.dialog_close> <.button phx-click={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")}>Continue</.button> </.dialog_footer> </.dialog> </div>
<div class="flex items-center gap-4"> <button class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-xs transition-colors hover:bg-primary/90" onclick="this.parentElement.querySelector('dialog').dispatchEvent(new Event('phx-shadcn:show'))">Open Wide Dialog</button> <.dialog id="dialog-single-custom-width" class="sm:max-w-2xl" on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")} > <.dialog_header> <.dialog_title id="dialog-wide-title">Wide dialog</.dialog_title> <.dialog_description id="dialog-wide-description"> This dialog uses a wider max-width override (sm:max-w-2xl). </.dialog_description> </.dialog_header> <p class="text-sm text-muted-foreground"> The content area is wider than the default sm:max-w-lg. </p> <.dialog_footer> <.dialog_close on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")}> <.button>Close</.button> </.dialog_close> </.dialog_footer> </.dialog> </div>
<div class="flex items-center gap-4"> <button class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-xs transition-colors hover:bg-primary/90" onclick="this.parentElement.querySelector('dialog').dispatchEvent(new Event('phx-shadcn:show'))">View License</button> <.dialog id="dialog-single-scrollable" class="max-h-[85vh] overflow-y-auto" on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")} > <.dialog_header> <.dialog_title id="dialog-scroll-title">MIT License</.dialog_title> <.dialog_description id="dialog-scroll-description"> Full license text below. </.dialog_description> </.dialog_header> <div class="text-sm text-muted-foreground leading-relaxed space-y-4"> <p>Copyright (c) 2024 PhxShadcn</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </div> <.dialog_footer> <.dialog_close on_cancel={Phoenix.LiveView.JS.dispatch("phx-shadcn:hide")}> <.button>Close</.button> </.dialog_close> </.dialog_footer> </.dialog> </div>