polotno-project/polotno-studio

Changing the title name of Default Side panel tabs ?

sohaib57 opened this issue · 1 comments


const index = DEFAULT_SECTIONS.findIndex(object =>{
  return object.name === "templates"
})
DEFAULT_SECTIONS[index].name = "Laila"

I'm trying to change the default name of side panel tab from templates to sample templates. It is changed but not rendering as changed don't know what the issue is ?

is there any way to change the name of DEFAULT_SECTIONS

object.name here is like a private/internal name of the tab. It is not displayed in UI.

If you want to change UI, you need to redefine Tab component:

import { Icon } from "@blueprintjs/core";
import { SidePanel, DEFAULT_SECTIONS, SectionTab } from "polotno/side-panel";

const index = DEFAULT_SECTIONS.findIndex((object) => {
  return object.name === "templates";
});
DEFAULT_SECTIONS[index].Tab = (props) => {
  return (
    <SectionTab name="Laila" {...props}>
      <Icon icon="control" />
    </SectionTab>
  );
};