You can customize tool palette by the following properties.
```javascript
/**
* Properties of MlToolPalette component
*/
interface Props {
/**
* The title of tool palette dialog
*/
title?: string
/**
* Array of tab definitions. If provided, the tool palette will display tabs.
*/
tabs?: MlToolPaletteTab[]
/**
* The minimum distance from the left side of the tool palette to the left side of the window
*/
leftOffset?: number
/**
* The minimum distance from the right side of the tool palette to the right side of the window
*/
rightOffset?: number
/**
* The minimum distance from the top side of the tool palette to the top side of the window
*/
topOffset?: number
/**
* The minimum distance from the bottom side of the tool palette to the bottom side of the window
*/
bottomOffset?: number
}
```
Tabs in tool palette are described by the following data structure.
```javascript
/**
* Tab definition for tool palette
*/
export interface MlToolPaletteTab {
/**
* Unique name identifier for the tab
*/
name: string
/**
* Display label for the tab
*/
label: string
/**
* Title to display in the title bar when this tab is active
*/
title?: string
}
```
Four `offsetXXX` properties are used to set the minimum distance from the side of the tool palette to the side of the window. It is quite useful if you want the tool palette is shown within certain area. For example, one web page has one title bar at the top of window, one status bar at the bottom of window, and one canvas area between the title bar and the status bar. The height of the title bar is 60px and the height of the status bar is 20px. Then you can set `topOffset` to 60 and `bottomOffset` to 20 to let the tool palette are shown and moved within canvas area only.
#### Basic Usage
```javascript
This is the Blocks tab content.
This is the Hatches tab content.
This is the Tools tab content.
Features above can be customized by the following properties.
```javascript
/**
* Properties of MLToolBar components
*/
interface Props {
/**
* An array of button data
*/
items: MlButtonData[]
/**
* Button size.
* - small: 30px
* - medium: 50px
* - large: 70px
*/
size?: 'small' | 'medium'| 'large'
/**
* Layout type.
* - vertical: arrange button vertically
* - horizontal: arrange button horizontally
*/
direction?: 'vertical' | 'horizontal'
}
```
Buttons in toolbar are described by the following data. Property `icon` can be icon provided by Element Plus or icon imported through `vite-svg-loader`.
```javascript
/**
* Data to descibe button appearance
*/
export interface MlButtonData {
/**
* Icon represented by one vue component
*/
icon: Component
/**
* Text shown below icon
*/
text: string
/**
* Command string which will be passed to click event as event arguments
*/
command: string
/**
* Tooltips content when hover
*/
description?: string
}
```
Usage of this component is as follows.
```javascript