dialog
An interactive element that opens on top of the page content.
Import
Import just the dialog styles.
@import "@winnie-ui/css/spatial/dialog";@import "@winnie-ui/css/visual/dialog";
Anatomy
Attach the appropriate data
attributes in the structure below.
<dialog data-component="dialog"> <header data-component="dialog-header"> <button data-slot="close" /> </header> <h3 data-slot="title" /> <p data-slot="description" /> <div data-component="dialog-content" /> <footer data-component="footer"> <button data-slot="cancel" /> <button data-slot="action" /> </footer></dialog>
Examples
Size
Use the data-size
attribute to change the max width of the dialog.
Header
Use the dialog-header
component to add a header to the dialog.
Close
Use the close
slot component to add a close button to the top right of the dialog.
Content
Use the dialog-content
component to add content, like a form, to the dialog.
Fields
Use fields like input
and textarea
as the title
and description
slots.
Reference
dialog
Groups all of the parts of the dialog together.