Files
medusa-store/www/apps/ui/src/examples/command-bar-demo.tsx
Kasper Fabricius Kristensen 4e3f3b54cb docs(ui,docs): Add documentation for Medusa UI 2.0.0 (#5227)
* add docs for medusa ui 2.0.0

* fix: copy as child example

* fix: dropdown menu example

* add accordion examples

* fix lint issues

* fix apos in progress tabs demo

* resolve comments

* add icon

* bump z-index on modals to prevent clashing with navbar

* add sidebar item and card

* undo modal z index changes

* add links to updated and new components

* update version

* rm inline code formatting on links

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-09-27 18:56:25 +03:00

42 lines
1.1 KiB
TypeScript

import { Checkbox, CommandBar, Label } from "@medusajs/ui"
import * as React from "react"
export default function CommandBarDemo() {
const [selected, setSelected] = React.useState<boolean>(false)
return (
<div className="flex items-center justify-center">
<div className="flex items-center gap-x-2">
<Checkbox
checked={selected}
onCheckedChange={(checked) =>
setSelected(checked === true ? true : false)
}
/>
<Label>Item One</Label>
</div>
<CommandBar open={selected}>
<CommandBar.Bar>
<CommandBar.Value>1 selected</CommandBar.Value>
<CommandBar.Seperator />
<CommandBar.Command
action={() => {
alert("Delete")
}}
label="Delete"
shortcut="d"
/>
<CommandBar.Seperator />
<CommandBar.Command
action={() => {
alert("Edit")
}}
label="Edit"
shortcut="e"
/>
</CommandBar.Bar>
</CommandBar>
</div>
)
}