Skip to main content
Answered

How can I change Sticky Note’s font size?

  • 13 July 2024
  • 1 reply
  • 34 views

Hey Guys.
I wanna change Sticky Note’s font size bia Miro’s SDK or API.
I wanna make Miro app to fix Sticky Note’s font size for easy to see.

I’ve watched reference page, but I can’t find it.
https://developers.miro.com/docs/websdk-reference-sticky-note

1 reply

Userlevel 4
Badge +1

Hi @mistletoe 

While you cannot directly change the font size, you can use the `await miro.board.createStickyNote` method to create a sticky note, and in there, you can use either the height or width parameter to increase the default size of the sticky. The font of the sticky will also increase to match the new size of the sticky. 

For example, you can try something like the code below which will set the height parameter to be larger than it normally is:

const stickyNote = await miro.board.createStickyNote({
content: '<p>This is a sticky note. It looks just like the actual paper one.</p>',
style: {
fillColor: 'light_yellow', // Default value: light yellow
textAlign: 'center', // Default alignment: center
textAlignVertical: 'middle', // Default alignment: middle
},
x: 0, // Default value: horizontal center of the board
y: 0, // Default value: vertical center of the board
shape: 'square',
height: 3300, // Set either 'width', or 'height'
});

// Output the created item to the developer console
console.log(stickyNote);

Hope it helps!

Reply