mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-28 15:14:12 +00:00
* feat(www): add login blocks * chore(www): restructure for blocks * chore: build registry * chore: clean up chunks * fix(www): chart categories * feat(www): big registry refactor * feat(www): update blocks * feat: complex blocks * fix: update schema * feat: sync new-york and default * fix: lint * feat: move charts * fix(www): code * fix: src path * chore: rebuild registry * fix: screenshot * fix: set new-york as default
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { DropdownMenuCheckboxItemProps } from "@radix-ui/react-dropdown-menu"
|
|
|
|
import { Button } from "@/registry/default/ui/button"
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuCheckboxItem,
|
|
DropdownMenuContent,
|
|
DropdownMenuLabel,
|
|
DropdownMenuSeparator,
|
|
DropdownMenuTrigger,
|
|
} from "@/registry/default/ui/dropdown-menu"
|
|
|
|
type Checked = DropdownMenuCheckboxItemProps["checked"]
|
|
|
|
export default function DropdownMenuCheckboxes() {
|
|
const [showStatusBar, setShowStatusBar] = React.useState<Checked>(true)
|
|
const [showActivityBar, setShowActivityBar] = React.useState<Checked>(false)
|
|
const [showPanel, setShowPanel] = React.useState<Checked>(false)
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<Button variant="outline">Open</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-56">
|
|
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
|
|
<DropdownMenuSeparator />
|
|
<DropdownMenuCheckboxItem
|
|
checked={showStatusBar}
|
|
onCheckedChange={setShowStatusBar}
|
|
>
|
|
Status Bar
|
|
</DropdownMenuCheckboxItem>
|
|
<DropdownMenuCheckboxItem
|
|
checked={showActivityBar}
|
|
onCheckedChange={setShowActivityBar}
|
|
disabled
|
|
>
|
|
Activity Bar
|
|
</DropdownMenuCheckboxItem>
|
|
<DropdownMenuCheckboxItem
|
|
checked={showPanel}
|
|
onCheckedChange={setShowPanel}
|
|
>
|
|
Panel
|
|
</DropdownMenuCheckboxItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)
|
|
}
|