Toolbar

A Figma-inspired toolbar component for tool selection and controls.

Usage

1import { Toolbar } from "aviris-components";23export default function ToolbarDemo() {4  return (5    <Toolbar />6  );7}

Custom Tools

1import { Toolbar } from "aviris-components";2import { Pencil, Eraser, ColorPicker } from "lucide-react";34const customTools = [5  { icon: <Pencil size={16} />, label: "Draw", tooltip: "Draw Tool (B)" },6  { icon: <Eraser size={16} />, label: "Erase", tooltip: "Eraser Tool (E)" },7  { icon: <ColorPicker size={16} />, label: "Color", tooltip: "Color Picker (I)" },8];910export default function CustomToolbarDemo() {11  return (12    <Toolbar tools={customTools} />13  );14}

With Tooltips

Hover over the tools to see tooltips with keyboard shortcuts.

1import { Toolbar } from "aviris-components";23export default function TooltipToolbarDemo() {4  return (5    <Toolbar6      tools={[7        { icon: <Mouse size={16} />, label: "Select", tooltip: "Select Tool (V)" },8        { icon: <Hand size={16} />, label: "Hand", tooltip: "Pan Around (H)" },9      ]}10    />11  );12}

Props

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The orientation of the toolbar.
size"default" | "sm" | "lg""default"The size of the toolbar.
toolsToolItem[]defaultToolsArray of tools to display in the toolbar.
classNamestring-Additional CSS classes to apply.

ToolItem Interface

PropertyTypeDescription
iconReact.ReactNodeRequired. The icon to display for the tool.
labelstringRequired. The name of the tool.
tooltipstringOptional tooltip text to show on hover.
onClick() => voidOptional click handler for the tool.