Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Thickness

Index

Constructors

constructor

  • new Thickness(top: number, right: number, bottom: number, left: number): Thickness
  • Creates an instance of a Thickness object, with top, right, bottom and left

    Parameters

    • top: number
    • right: number
    • bottom: number
    • left: number

    Returns Thickness

Properties

bottom

bottom: number

Gets or sets the bottom amount

left

left: number

Gets or sets the left amount

right

right: number

Gets or sets the right amount

top

top: number

Gets or sets the top amount

Methods

Static areEqual

  • Returns whether two Thickness instances are equal or not

    example

    const t1 = new Thickness(4,4,4,4); const t2 = new Thickness.fromNumber(4); console.log(Thickness.areEqual(t1, t2)); // True

    Parameters

    Returns boolean

Static fromNumber

  • Creates a Thickness (margin or padding) from a single value, e.g. 10, would return a thickness with top, right, bottom left = 10

    Parameters

    • value: number

    Returns Thickness

Static fromString

  • Creates a Thickness (margin or padding) from string, e.g. "25 50 75 100". Order is top, right, bottom left. Same as in Css

    Parameters

    • str: string

    Returns Thickness

Static mergeMax

  • Returns the max of each side of 2 components in a new Thickness object

    example

    const t1 = new Thickness(1,2,3,4); const t2 = new Thickness(4,3,2,1); console.log(Thickness.mergeMax(t1, t2)); // Thickness { top: 4, right: 3, bottom: 3, left: 4 }

    Parameters

    Returns Thickness

Generated using TypeDoc