@moxijs/ui - v0.3.5
    Preparing search index...

    Class EdgeInsets

    Represents spacing values for the edges of a box (top, right, bottom, left). Similar to CSS padding/margin syntax.

    Index

    Constructors

    • Creates an EdgeInsets with specific values for each edge

      Parameters

      • top: number

        Top edge spacing

      • right: number

        Right edge spacing

      • bottom: number

        Bottom edge spacing

      • left: number

        Left edge spacing

      Returns EdgeInsets

    Properties

    bottom: number

    Bottom edge spacing

    left: number

    Left edge spacing

    right: number

    Right edge spacing

    top: number

    Top edge spacing

    Accessors

    • get horizontal(): number

      Gets the total horizontal spacing (left + right)

      Returns number

    • get vertical(): number

      Gets the total vertical spacing (top + bottom)

      Returns number

    Methods

    • Creates EdgeInsets with the same value for all edges Similar to CSS: padding: 10px

      Parameters

      • value: number

        The value to apply to all edges

      Returns EdgeInsets

      const padding = EdgeInsets.all(20); // 20px on all sides
      
    • Creates EdgeInsets from flexible input. Accepts a number (all sides equal), an EdgeInsets instance, or an object with individual sides.

      Parameters

      • input:
            | number
            | EdgeInsets
            | { bottom?: number; left?: number; right?: number; top?: number }

        Number, EdgeInsets, or object with edge values

      Returns EdgeInsets

      EdgeInsets.from(10);                    // All sides 10
      EdgeInsets.from({ top: 5, left: 10 }); // Top 5, left 10, others 0
      EdgeInsets.from(existingInsets); // Clone
    • Creates EdgeInsets with specific values for individual edges Similar to CSS: padding-top, padding-right, etc.

      Parameters

      • edges: { bottom?: number; left?: number; right?: number; top?: number }

        Object with optional top, right, bottom, left values (defaults to 0)

      Returns EdgeInsets

      const padding = EdgeInsets.only({ top: 10, left: 20 }); // 10px top, 20px left, 0px right/bottom
      
    • Creates EdgeInsets with symmetric vertical and horizontal values Similar to CSS: padding: 10px 20px

      Parameters

      • vertical: number

        Value for top and bottom edges

      • horizontal: number

        Value for left and right edges

      Returns EdgeInsets

      const padding = EdgeInsets.symmetric(10, 20); // 10px top/bottom, 20px left/right