From e90b64b463f9ebcb2661b112dae92a0d839731e8 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 9 Nov 2022 09:58:04 -0500 Subject: [PATCH] revert example --- docs/components/dialog.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/components/dialog.md b/docs/components/dialog.md index 3a91200e..31155173 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.