Toolbar Primitive
A container designed for organizing a collection of controls, such as buttons, toggle groups, or dropdown menus.
Installation
Install the component via your command line.
Install @radix-ui/react-toolbar
Copy/paste the following code for web to ~/components/primitives/toolbar/toolbar.web.tsx
Copy/paste the following code for native to ~/components/primitives/toolbar/toolbar.tsx
Copy/paste the following code for types to ~/components/primitives/toolbar/types.ts
Copy/paste the following code for exporting to ~/components/primitives/toolbar/index.ts
Copy/paste the following code for native to ~/components/primitives/toolbar/index.tsx
Copy/paste the following code for types to ~/components/primitives/toolbar/types.ts
Usage
Props
Root
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
orientation | ’horizontal’ | ‘vertical’ | Web Only (optional) |
dir | (value: boolean) => void | Web Only (optional) |
loop | boolean | Web Only (optional) |
ToggleGroup
Extends View
props
Prop | Type | Note |
---|---|---|
type | ’single’ | ‘multiple’ | |
value | string | undefined | string[] | |
onValueChange | (val: string | undefined | string[]) => void | |
asChild | boolean | (optional) |
disabled | boolean | (optional) |
ToggleItem
Extends Pressable
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
value | string |
Separator
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
Link
Extends Pressable
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |