Socket
Socket
Sign inDemoInstall

@radix-ui/react-toolbar

Package Overview
Dependencies
Maintainers
6
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-toolbar


Version published
Weekly downloads
1.9M
decreased by-0.66%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/react-toolbar?

@radix-ui/react-toolbar is a React component library that provides accessible and customizable toolbar components. It allows developers to create toolbars with various interactive elements such as buttons, toggle groups, and separators, ensuring a consistent and accessible user experience.

What are @radix-ui/react-toolbar's main functionalities?

Toolbar

The Toolbar component is the main container for toolbar items. It can contain various interactive elements like buttons. This example demonstrates a simple toolbar with two buttons.

import { Toolbar, ToolbarButton } from '@radix-ui/react-toolbar';

function MyToolbar() {
  return (
    <Toolbar>
      <ToolbarButton>Button 1</ToolbarButton>
      <ToolbarButton>Button 2</ToolbarButton>
    </Toolbar>
  );
}

ToolbarButton

The ToolbarButton component is used to create buttons within the toolbar. This example shows a single button labeled 'Click Me'.

import { ToolbarButton } from '@radix-ui/react-toolbar';

function MyButton() {
  return (
    <ToolbarButton>Click Me</ToolbarButton>
  );
}

ToolbarSeparator

The ToolbarSeparator component is used to visually separate groups of toolbar items. This example demonstrates a toolbar with two buttons separated by a separator.

import { Toolbar, ToolbarButton, ToolbarSeparator } from '@radix-ui/react-toolbar';

function MyToolbar() {
  return (
    <Toolbar>
      <ToolbarButton>Button 1</ToolbarButton>
      <ToolbarSeparator />
      <ToolbarButton>Button 2</ToolbarButton>
    </Toolbar>
  );
}

ToolbarToggleGroup

The ToolbarToggleGroup component is used to group toggle items, allowing for single or multiple selection. This example shows a toggle group with 'Bold' and 'Italic' options, with 'Bold' selected by default.

import { Toolbar, ToolbarToggleGroup, ToolbarToggleItem } from '@radix-ui/react-toolbar';

function MyToolbar() {
  return (
    <Toolbar>
      <ToolbarToggleGroup type="single" defaultValue="bold">
        <ToolbarToggleItem value="bold">Bold</ToolbarToggleItem>
        <ToolbarToggleItem value="italic">Italic</ToolbarToggleItem>
      </ToolbarToggleGroup>
    </Toolbar>
  );
}

Other packages similar to @radix-ui/react-toolbar

FAQs

Package last updated on 19 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc