Skip to content

How do I set the initial size of a node? #1353

Answered by bcakmakoglu
CodyBontecou asked this question in Q&A
Discussion options

You must be logged in to vote

You can pass width and height to a node, which will be applied as a style.

interface Node {
  // ...

  /**
   * Fixed width of node, applied as style
   * You can pass a number which will be used in pixel values (width: 300 -> width: 300px)
   * or pass a string with units (width: `10rem` -> width: 10rem)
   */
  width?: number | string | WidthFunc
  /**
   * Fixed height of node, applied as style
   * You can pass a number which will be used in pixel values (height: 300 -> height: 300px)
   * or pass a string with units (height: `10rem` -> height: 10rem)
   */
  height?: number | string | HeightFunc

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@CodyBontecou
Comment options

@CodyBontecou
Comment options

@bcakmakoglu
Comment options

Answer selected by CodyBontecou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants