Toolbar example

Vertical tool strip with bounded focus.

Choose a review tool with Up and Down Arrow. Focus stops at each end, and a disabled tool is skipped.

Complete React client module · MIT · Next.js and Vite

Interactive example

Vertical tool strip with bounded focus

Choose a review tool with Up and Down Arrow. Focus stops at each end, and a disabled tool is skipped.

Keyboard

  • Up and Down Arrow navigate vertically; loopFocus=false stops at the first and last item.
  • The locked drawing tool uses focusableWhenDisabled=false and is skipped.
  • Disabled toolbar buttons cannot activate. Its help link remains navigable, following Base UI links.

States covered

  • vertical orientation
  • no focus loop
  • skipped disabled tool
  • disabled toolbar
  • icon labels
  • navigable help link

Install this complete example and its component dependencies.

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/example-toolbar-vertical-tools.json
Complete source
React / TypeScript
/*!
MIT License

Copyright (c) 2026 Jaison

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import '@bld8/ui/styles.css';
import {useState} from 'react';
import {Hand,MessageSquare,MousePointer2,Pencil} from 'lucide-react';
import {Checkbox,Icon} from '@bld8/ui';
import {Toolbar,ToolbarButton,ToolbarLink,ToolbarSeparator} from '@bld8/ui/toolbar';
export default function VerticalToolsExample(){
  const [tool,setTool]=useState('Select'),[disabled,setDisabled]=useState(false);
  return <div style={{display:'grid',gap:16}}><Checkbox label="Disable review tools" checked={disabled} onCheckedChange={setDisabled}/><div style={{display:'flex',alignItems:'flex-start',gap:20}}>
    <Toolbar label="Review tools" orientation="vertical" loopFocus={false} disabled={disabled}>
      {[{label:'Select',icon:MousePointer2},{label:'Pan',icon:Hand},{label:'Comment',icon:MessageSquare}].map(item=><ToolbarButton key={item.label} aria-label={item.label+' tool'} aria-pressed={tool===item.label} onClick={()=>setTool(item.label)}><Icon icon={item.icon} size={18}/></ToolbarButton>)}
      <ToolbarButton aria-label="Drawing tool locked" disabled focusableWhenDisabled={false}><Icon icon={Pencil} size={18}/></ToolbarButton>
      <ToolbarSeparator/><ToolbarLink href="#review-tool-help" aria-label="Tool help">?</ToolbarLink>
    </Toolbar><div><p role="status">Active tool: {tool}</p><p id="review-tool-help" className="bui-hint">Select inspects a review item, Pan moves its view, and Comment places a note. This example demonstrates tool selection only.</p></div>
  </div></div>;
}