Toggle-group
How to use the Toggle-group component from the Default kit.
import { Canvas } from "@react-three/fiber"; import { Fullscreen } from "@react-three/uikit"; import { Defaults, DialogAnchor } from "@react-three/uikit-default"; import { Bold, Italic, Underline } from '@react-three/uikit-lucide' import { ToggleGroup, ToggleGroupItem } from "@react-three/uikit-default" function ToggleGroupDemo() { return ( <ToggleGroup> <ToggleGroupItem aria-label="Toggle bold"> <Bold height={16} width={16} /> </ToggleGroupItem> <ToggleGroupItem aria-label="Toggle italic"> <Italic height={16} width={16} /> </ToggleGroupItem> <ToggleGroupItem aria-label="Toggle underline"> <Underline width={16} height={16} /> </ToggleGroupItem> </ToggleGroup> ) } export default function App() { return ( <Canvas style={{ position: "absolute", inset: "0", touchAction: "none" }} gl={{ localClippingEnabled: true }}> <ambientLight intensity={0.5} /> <directionalLight intensity={1} position={[-5, 5, 10]} /> <Defaults> <Fullscreen overflow="scroll" scrollbarColor="black" backgroundColor="white" dark={{ backgroundColor: "black" }} flexDirection="column" gap={32} paddingX={32} alignItems="center" padding={32} > <DialogAnchor><ToggleGroupDemo /></DialogAnchor> </Fullscreen> </Defaults> </Canvas> ) }
npx uikit component add default toggle-group