docx
    Preparing search index...

    Class Attributes

    Common XML attributes used across WordprocessingML elements.

    This class provides a convenient way to add common attributes to XML elements. It automatically maps JavaScript-friendly property names to their corresponding w: (WordprocessingML) namespace prefixed XML attribute names.

    // Create an element with a value attribute
    new Attributes({ val: "someValue" });
    // Generates: <element w:val="someValue"/>

    // Multiple attributes
    new Attributes({ color: "FF0000", sz: "24" });
    // Generates: <element w:color="FF0000" w:sz="24"/>

    Hierarchy (View Summary)

    • XmlAttributeComponent<
          {
              bottom?: string;
              color?: string;
              fill?: string;
              footer?: string;
              gutter?: string;
              h?: string;
              header?: string;
              left?: string;
              linePitch?: string;
              pos?: string
              | number;
              right?: string;
              rsidR?: string;
              rsidRPr?: string;
              rsidSect?: string;
              space?: string;
              sz?: string;
              top?: string;
              type?: string;
              val?: string | number | boolean;
              w?: string;
          },
      >
      • Attributes
    Index

    Constructors

    Methods

    Constructors

    • Creates a new attribute component.

      Parameters

      • root: {
            bottom?: string;
            color?: string;
            fill?: string;
            footer?: string;
            gutter?: string;
            h?: string;
            header?: string;
            left?: string;
            linePitch?: string;
            pos?: string | number;
            right?: string;
            rsidR?: string;
            rsidRPr?: string;
            rsidSect?: string;
            space?: string;
            sz?: string;
            top?: string;
            type?: string;
            val?: string | number | boolean;
            w?: string;
        }

        The attribute data object

        • Optional Readonlybottom?: string

          Bottom margin/spacing (w:bottom).

        • Optional Readonlycolor?: string

          Color value (w:color).

        • Optional Readonlyfill?: string

          Fill color (w:fill).

        • Optional Readonlyfooter?: string

          Footer margin (w:footer).

        • Optional Readonlygutter?: string

          Gutter margin (w:gutter).

        • Optional Readonlyh?: string

          Height (w:h).

        • Optional Readonlyheader?: string

          Header margin (w:header).

        • Optional Readonlyleft?: string

          Left margin/spacing (w:left).

        • Optional ReadonlylinePitch?: string

          Line pitch (w:linePitch).

        • Optional Readonlypos?: string | number

          Position value (w:pos).

        • Optional Readonlyright?: string

          Right margin/spacing (w:right).

        • Optional ReadonlyrsidR?: string

          Revision ID for run content (w:rsidR).

        • Optional ReadonlyrsidRPr?: string

          Revision ID for run properties (w:rsidRPr).

        • Optional ReadonlyrsidSect?: string

          Revision ID for section (w:rsidSect).

        • Optional Readonlyspace?: string

          Space preservation (w:space).

        • Optional Readonlysz?: string

          Size value (w:sz).

        • Optional Readonlytop?: string

          Top margin/spacing (w:top).

        • Optional Readonlytype?: string

          Type specification (w:type).

        • Optional Readonlyval?: string | number | boolean

          Generic value attribute (w:val).

        • Optional Readonlyw?: string

          Width (w:w).

      Returns Attributes

    Methods