How to Customize the Description in Symbol Palette in React Diagram
The Symbol Palette in Syncfusion® React Diagram, allows you to add and customize descriptions for the symbols displayed. This can enhance the usability of the palette by providing additional information about each symbol.
You can customize the descriptions of symbols in the palette by implementing the getSymbolInfo function. This sample demonstrates how to set up a symbol palette with descriptions:
//Initializes the symbol palette
function SymbolPalette() {
//To provide information about each symbol
function symbolInfo(symbol) {
return {
description: {
text: (symbol.addInfo).text, // Define how text overflow is handled
overflow:'Clip', // Customize the display text
wrap: "WrapWithOverflow", // Set text wrapping
fontSize: 12 // Define the font size of the description
},
};
}
return (<div className="control-pane diagram-symbolpalette">
//Define Symbolpalette component
<SymbolPaletteComponent id="symbolpalette"
ref={symbolpal => (palette = symbolpal)}
palettes={[
{
id: "connectors",
expanded: true,
symbols: connectorSymbols,
title: "Connectors",
}
]}
symbolWidth={100} symbolHeight={100}
getSymbolInfo={symbolInfo.bind(this)}/>
</div>);
}
export default SymbolPalette;
Sample: Click Here
Conclusion
I hope you enjoyed learning how to Customize the Description in Symbol Palette in React Diagram. You can refer to our React Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our React Diagram example to understand how to create and manipulate data. For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!