diff --git a/docs/components/dialog.md b/docs/components/dialog.md index 3a91200e9..311551735 100644 --- a/docs/components/dialog.md +++ b/docs/components/dialog.md @@ -5,12 +5,8 @@ [component-header:sl-dialog] ```html preview - - - Option 1 - Option 2 - Option 3 - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Close @@ -26,6 +22,28 @@ ``` +```jsx react +import { useState } from 'react'; +import { SlButton, SlDialog } from '@shoelace-style/shoelace/dist/react'; + +const App = () => { + const [open, setOpen] = useState(false); + + return ( + <> + setOpen(false)}> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + setOpen(false)}> + Close + + + + setOpen(true)}>Open Dialog + + ); +}; +``` + ## UX Tips - Use a dialog when you immediately require the user's attention, e.g. confirming a destructive action.