x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<div class="contents" data-controller="ui--dialog"> <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! bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 disabled:cursor-not-allowed" aria-haspopup="dialog" aria-expanded="false" aria-controls="ui-dialog-70c8b51c" data-ui--dialog-target="trigger" data-action="click->ui--dialog#open">Open dialog</button><dialog id="ui-dialog-70c8b51c" class="fixed inset-0 m-0 p-0 max-w-none max-h-none w-full h-full bg-transparent border-0 overflow-visible open:flex open:items-center open:justify-center backdrop:bg-black/60 backdrop:backdrop-blur-[1px]" aria-labelledby="ui-dialog-70c8b51c-title" aria-describedby="ui-dialog-70c8b51c-description" data-ui--dialog-target="content" data-state="closed"> <div class="relative flex flex-col w-full max-h-[calc(100vh-2rem)] overflow-hidden rounded-lg border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 max-w-lg" data-state="closed" data-ui--dialog-part="panel"> <header class="flex flex-col space-y-1.5 text-center sm:text-left"> <h2 id="ui-dialog-70c8b51c-title" class="text-lg font-semibold leading-none tracking-tight">Edit profile</h2> <p id="ui-dialog-70c8b51c-description" class="text-sm text-muted-foreground">Make changes to your profile here. Click save when you're done.</p> </header> <div class="overflow-y-auto flex-1 min-h-0 mt-4"> Dialog body content lives here. </div> <footer class="mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"> <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-label="Close" data-action="click->ui--dialog#close" data-ui-dialog-close="true"> Cancel </button> <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! bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 disabled:cursor-not-allowed" aria-busy="false">Save changes</button> </footer> </div></dialog></div>1
2
3
4
5
6
7
8
9
10
11
12
<%= render(UI::Dialog.new) do |dialog| %> <% dialog.with_trigger(variant: @trigger_variant) { "Open dialog" } %> <% dialog.with_content(size: @size, show_close: @show_close) do |content| %> <% content.with_title { "Edit profile" } %> <% content.with_description { "Make changes to your profile here. Click save when you're done." } %> <% content.with_footer do %> <%= render(UI::Dialog::Close.new(variant: :outline)) { "Cancel" } %> <%= render(UI::Button.new) { "Save changes" } %> <% end %> Dialog body content lives here. <% end %><% end %>No notes provided.
| Param | Description | Input |
|---|---|---|
|
— |
|
|
|
— |
|
|
|
— |
|