<?xml version="1.0" encoding="US-ASCII"?>
<!-- DFIN New ActiveDisclosure (SM) XBRL Schema Document - http://www.dfinsolutions.com/ -->
<!-- Creation Date :2025-02-24T08:23:40.3564+00:00 -->
<!-- Copyright (c) 2025 Donnelley Financial Solutions, Inc. All Rights Reserved. -->
<xsd:schema targetNamespace="http://www.trex.com/20241231" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:dtr-types="http://www.xbrl.org/dtr/type/2022-03-31" xmlns:ecd-sub="http://xbrl.sec.gov/ecd-sub/2024" xmlns:ecd="http://xbrl.sec.gov/ecd/2024" xmlns:trex="http://www.trex.com/20241231" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:dei="http://xbrl.sec.gov/dei/2024" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:cyd="http://xbrl.sec.gov/cyd/2024" xmlns:enum2="http://xbrl.org/2020/extensible-enumerations-2.0" xmlns:srt="http://fasb.org/srt/2024" xmlns:us-gaap="http://fasb.org/us-gaap/2024" xmlns:xlink="http://www.w3.org/1999/xlink">
  <xsd:import schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" namespace="http://www.xbrl.org/2003/instance"/>
  <xsd:import schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" namespace="http://www.xbrl.org/2003/linkbase"/>
  <xsd:import schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd" namespace="http://xbrl.org/2005/xbrldt"/>
  <xsd:import schemaLocation="https://xbrl.sec.gov/ecd/2024/ecd-sub-2024.xsd" namespace="http://xbrl.sec.gov/ecd-sub/2024"/>
  <xsd:import schemaLocation="https://www.xbrl.org/2020/extensible-enumerations-2.0.xsd" namespace="http://xbrl.org/2020/extensible-enumerations-2.0"/>
  <xsd:import schemaLocation="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd" namespace="http://fasb.org/srt/2024"/>
  <xsd:import schemaLocation="https://xbrl.sec.gov/dei/2024/dei-2024.xsd" namespace="http://xbrl.sec.gov/dei/2024"/>
  <xsd:import schemaLocation="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd" namespace="http://fasb.org/us-gaap/2024"/>
  <xsd:import schemaLocation="https://www.xbrl.org/dtr/type/2022-03-31/types.xsd" namespace="http://www.xbrl.org/dtr/type/2022-03-31"/>
  <xsd:import schemaLocation="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd" namespace="http://xbrl.sec.gov/cyd/2024"/>
  <xsd:import schemaLocation="https://xbrl.sec.gov/ecd/2024/ecd-2024.xsd" namespace="http://xbrl.sec.gov/ecd/2024"/>
  <xsd:import schemaLocation="https://www.xbrl.org/2023/calculation-1.1.xsd" namespace="https://xbrl.org/2023/calculation-1.1"/>
  <xsd:annotation>
    <xsd:appinfo>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/CoverPage" id="CoverPage">
        <link:definition>100000 - Document - Cover Page</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfComprehensiveIncome" id="ConsolidatedStatementsOfComprehensiveIncome">
        <link:definition>100010 - Statement - Consolidated Statements of Comprehensive Income</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureLeasesMaturitiesOfOperatingLeaseLiabilitiesDetail2" id="DisclosureLeasesMaturitiesOfOperatingLeaseLiabilitiesDetail2">
        <link:definition>100020 - Disclosure - Leases - Maturities of Operating Lease Liabilities (Detail) 2</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheets" id="ConsolidatedBalanceSheets">
        <link:definition>100030 - Statement - Consolidated Balance Sheets</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheetsParenthetical" id="ConsolidatedBalanceSheetsParenthetical">
        <link:definition>100040 - Statement - Consolidated Balance Sheets (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfChangesInStockholdersEquity" id="ConsolidatedStatementsOfChangesInStockholdersEquity">
        <link:definition>100050 - Statement - Consolidated Statements of Changes in Stockholders' Equity</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfCashFlows" id="ConsolidatedStatementsOfCashFlows">
        <link:definition>100060 - Statement - Consolidated Statements of Cash Flows</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureCybersecurityRiskManagementStrategyAndGovernance" id="DisclosureCybersecurityRiskManagementStrategyAndGovernance">
        <link:definition>100070 - Disclosure - Cybersecurity Risk Management, Strategy and Governance</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganization" id="BusinessAndOrganization">
        <link:definition>995455 - Disclosure - Business and Organization</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPolicies" id="SummaryOfSignificantAccountingPolicies">
        <link:definition>995465 - Disclosure - Summary of Significant Accounting Policies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsInc" id="SaleOfTrexCommercialProductsInc">
        <link:definition>995475 - Disclosure - Sale of Trex Commercial Products, Inc.</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/Inventories" id="Inventories">
        <link:definition>995485 - Disclosure - Inventories</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssets" id="PrepaidExpensesAndOtherAssets">
        <link:definition>995495 - Disclosure - Prepaid Expenses and Other Assets</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNet" id="GoodwillAndOtherIntangibleAssetsNet">
        <link:definition>995505 - Disclosure - Goodwill and Other Intangible Assets, Net</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipment" id="PropertyPlantAndEquipment">
        <link:definition>995515 - Disclosure - Property, Plant and Equipment</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilities" id="AccruedExpensesAndOtherLiabilities">
        <link:definition>995525 - Disclosure - Accrued Expenses and Other Liabilities</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/Debt" id="Debt">
        <link:definition>995535 - Disclosure - Debt</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/Leases" id="Leases">
        <link:definition>995545 - Disclosure - Leases</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/FinancialInstruments" id="FinancialInstruments">
        <link:definition>995555 - Disclosure - Financial Instruments</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquity" id="StockholdersEquity">
        <link:definition>995565 - Disclosure - Stockholders' Equity</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomers" id="RevenueFromContractsWithCustomers">
        <link:definition>995575 - Disclosure - Revenue From Contracts With Customers</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensation" id="StockBasedCompensation">
        <link:definition>995585 - Disclosure - Stock-Based Compensation</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlans" id="EmployeeBenefitPlans">
        <link:definition>995595 - Disclosure - Employee Benefit Plans</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxes" id="IncomeTaxes">
        <link:definition>995605 - Disclosure - Income Taxes</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformation" id="SegmentInformation">
        <link:definition>995615 - Disclosure - Segment Information</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/Seasonality" id="Seasonality">
        <link:definition>995625 - Disclosure - Seasonality</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingencies" id="CommitmentsAndContingencies">
        <link:definition>995635 - Disclosure - Commitments and Contingencies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReserves" id="ScheduleIiValuationAndQualifyingAccountsAndReserves">
        <link:definition>995645 - Disclosure - Schedule II - Valuation and Qualifying Accounts and Reserves</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesPolicies" id="SummaryOfSignificantAccountingPoliciesPolicies">
        <link:definition>995655 - Disclosure - Summary of Significant Accounting Policies (Policies)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesTables" id="SummaryOfSignificantAccountingPoliciesTables">
        <link:definition>995665 - Disclosure - Summary of Significant Accounting Policies (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/InventoriesTables" id="InventoriesTables">
        <link:definition>995675 - Disclosure - Inventories (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsTables" id="PrepaidExpensesAndOtherAssetsTables">
        <link:definition>995685 - Disclosure - Prepaid Expenses and Other Assets (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentTables" id="PropertyPlantAndEquipmentTables">
        <link:definition>995695 - Disclosure - Property, Plant and Equipment (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesTables" id="AccruedExpensesAndOtherLiabilitiesTables">
        <link:definition>995705 - Disclosure - Accrued Expenses and Other Liabilities (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesTables" id="LeasesTables">
        <link:definition>995715 - Disclosure - Leases (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityTables" id="StockholdersEquityTables">
        <link:definition>995725 - Disclosure - Stockholders' Equity (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersTables" id="RevenueFromContractsWithCustomersTables">
        <link:definition>995735 - Disclosure - Revenue From Contracts With Customers (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationTables" id="StockBasedCompensationTables">
        <link:definition>995745 - Disclosure - Stock-Based Compensation (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesTables" id="IncomeTaxesTables">
        <link:definition>995755 - Disclosure - Income Taxes (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationTables" id="SegmentInformationTables">
        <link:definition>995765 - Disclosure - Segment Information (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesTables" id="CommitmentsAndContingenciesTables">
        <link:definition>995775 - Disclosure - Commitments and Contingencies (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganizationAdditionalInformationDetail" id="BusinessAndOrganizationAdditionalInformationDetail">
        <link:definition>995785 - Disclosure - Business and Organization - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" id="SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail">
        <link:definition>995795 - Disclosure - Summary of Significant Accounting Policies - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail" id="SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail">
        <link:definition>995805 - Disclosure - Summary of Significant Accounting Policies - Estimated Useful Lives of Property Plant and Equipment (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsIncAdditionalInformationDetail" id="SaleOfTrexCommercialProductsIncAdditionalInformationDetail">
        <link:definition>995815 - Disclosure - Sale of Trex Commercial Products, Inc. - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/InventoriesSummaryOfInventoriesDetail" id="InventoriesSummaryOfInventoriesDetail">
        <link:definition>995825 - Disclosure - Inventories - Summary of Inventories (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail" id="PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail">
        <link:definition>995835 - Disclosure - Prepaid Expenses and Other Assets - Summary of Prepaid Expenses and Other Assets (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" id="GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail">
        <link:definition>995845 - Disclosure - Goodwill and Other Intangible Assets, Net - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail" id="PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail">
        <link:definition>995855 - Disclosure - Property, Plant and Equipment - Summary of Property, Plant and Equipment (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentAdditionalInformationDetail" id="PropertyPlantAndEquipmentAdditionalInformationDetail">
        <link:definition>995865 - Disclosure - Property, Plant and Equipment - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail" id="AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail">
        <link:definition>995875 - Disclosure - Accrued Expenses and Other Liabilities - Summary of Accrued Expenses and Other Liabilities (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DebtAdditionalInformationDetail" id="DebtAdditionalInformationDetail">
        <link:definition>995885 - Disclosure - Debt - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesAdditionalInformationDetail" id="LeasesAdditionalInformationDetail">
        <link:definition>995895 - Disclosure - Leases - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetail" id="LeasesSupplementalCashFlowInformationToOperatingLeasesDetail">
        <link:definition>995905 - Disclosure - Leases - Supplemental Cash flow Information to operating leases (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail" id="LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail">
        <link:definition>995915 - Disclosure - Leases - Maturities of Operating Lease Liabilities (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAdditionalInformationDetail" id="StockholdersEquityAdditionalInformationDetail">
        <link:definition>995925 - Disclosure - Stockholders' Equity - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail" id="StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail">
        <link:definition>995935 - Disclosure - Stockholders' Equity - Computation of Basic and Diluted Earnings Per Share (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail" id="StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail">
        <link:definition>995945 - Disclosure - Stockholders' Equity - Antidilutive Securities Excluded from Computation of Earnings Per Share (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail" id="RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail">
        <link:definition>995955 - Disclosure - Revenue From Contracts With Customers - Summary of Disaggregated Net Sales (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationAdditionalInformationDetail" id="StockBasedCompensationAdditionalInformationDetail">
        <link:definition>995965 - Disclosure - Stock-Based Compensation - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail" id="StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail">
        <link:definition>995975 - Disclosure - Stock-Based Compensation - Summary of Stock-Based Compensation Expenses (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail" id="DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail">
        <link:definition>995985 - Disclosure - Stock-Based Compensation - Time-Based Restricted Stock Unit Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail" id="DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail">
        <link:definition>995995 - Disclosure - Stock-Based Compensation - Performance-Based Restricted Stock Unit Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail" id="StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail">
        <link:definition>996005 - Disclosure - Stock-Based Compensation - Summary of Assumptions Used to Estimate Fair Value of Each SAR (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSarActivityDetail" id="StockBasedCompensationSarActivityDetail">
        <link:definition>996015 - Disclosure - Stock-Based Compensation - SAR Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlansAdditionalInformationDetail" id="EmployeeBenefitPlansAdditionalInformationDetail">
        <link:definition>996025 - Disclosure - Employee Benefit Plans - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesIncomeTaxProvisionBenefitDetail" id="IncomeTaxesIncomeTaxProvisionBenefitDetail">
        <link:definition>996035 - Disclosure - Income Taxes - Income Tax Provision (Benefit) (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail" id="IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail">
        <link:definition>996045 - Disclosure - Income Taxes - Reconciliation of Differences between Income Tax Provision and Income Tax Determined by Applying US Federal Statutory Rate (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail" id="IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail">
        <link:definition>996055 - Disclosure - Income Taxes - Schedule of Deferred Tax Assets and Liabilities (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesAdditionalInformationDetail" id="IncomeTaxesAdditionalInformationDetail">
        <link:definition>996065 - Disclosure - Income Taxes - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationAdditionalInformationDetail" id="SegmentInformationAdditionalInformationDetail">
        <link:definition>996075 - Disclosure - Segment Information - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationDetailsOfSegmentInformationDetail" id="SegmentInformationDetailsOfSegmentInformationDetail">
        <link:definition>996085 - Disclosure - Segment Information - Details of Segment Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesAdditionalInformationDetail" id="CommitmentsAndContingenciesAdditionalInformationDetail">
        <link:definition>996095 - Disclosure - Commitments and Contingencies - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail" id="DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail">
        <link:definition>996105 - Disclosure - Commitments and Contingencies - Summary of Trex Residential Product Warranty and Surface Flaking Reserves Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType roleURI="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReservesDetail" id="ScheduleIiValuationAndQualifyingAccountsAndReservesDetail">
        <link:definition>996115 - Disclosure - Schedule II - Valuation and Qualifying Accounts and Reserves (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:linkbase id="lnk">
        <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="http://www.esma.europa.eu/xbrl/esef/arcrole/wider-narrower" xlink:href="http://www.xbrl.org/lrr/arcrole/esma-arcrole-2018-11-21.xsd#wider-narrower" xlink:type="simple"/>
        <link:arcroleRef arcroleURI="https://xbrl.org/2023/arcrole/summation-item" xlink:href="https://www.xbrl.org/2023/calculation-1.1.xsd#summation-item" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/CoverPage" xlink:href="trex-20241231.xsd#CoverPage" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfComprehensiveIncome" xlink:href="trex-20241231.xsd#ConsolidatedStatementsOfComprehensiveIncome" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheets" xlink:href="trex-20241231.xsd#ConsolidatedBalanceSheets" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheetsParenthetical" xlink:href="trex-20241231.xsd#ConsolidatedBalanceSheetsParenthetical" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfChangesInStockholdersEquity" xlink:href="trex-20241231.xsd#ConsolidatedStatementsOfChangesInStockholdersEquity" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfCashFlows" xlink:href="trex-20241231.xsd#ConsolidatedStatementsOfCashFlows" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureCybersecurityRiskManagementStrategyAndGovernance" xlink:href="trex-20241231.xsd#DisclosureCybersecurityRiskManagementStrategyAndGovernance" xlink:type="simple"/>
        <link:roleRef roleURI="http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements" xlink:href="https://xbrl.sec.gov/ecd/2024/ecd-2024.xsd#InsiderTradingArrangements" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganization" xlink:href="trex-20241231.xsd#BusinessAndOrganization" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPolicies" xlink:href="trex-20241231.xsd#SummaryOfSignificantAccountingPolicies" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsInc" xlink:href="trex-20241231.xsd#SaleOfTrexCommercialProductsInc" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/Inventories" xlink:href="trex-20241231.xsd#Inventories" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssets" xlink:href="trex-20241231.xsd#PrepaidExpensesAndOtherAssets" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNet" xlink:href="trex-20241231.xsd#GoodwillAndOtherIntangibleAssetsNet" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipment" xlink:href="trex-20241231.xsd#PropertyPlantAndEquipment" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilities" xlink:href="trex-20241231.xsd#AccruedExpensesAndOtherLiabilities" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/Debt" xlink:href="trex-20241231.xsd#Debt" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/Leases" xlink:href="trex-20241231.xsd#Leases" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/FinancialInstruments" xlink:href="trex-20241231.xsd#FinancialInstruments" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquity" xlink:href="trex-20241231.xsd#StockholdersEquity" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomers" xlink:href="trex-20241231.xsd#RevenueFromContractsWithCustomers" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensation" xlink:href="trex-20241231.xsd#StockBasedCompensation" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlans" xlink:href="trex-20241231.xsd#EmployeeBenefitPlans" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxes" xlink:href="trex-20241231.xsd#IncomeTaxes" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformation" xlink:href="trex-20241231.xsd#SegmentInformation" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/Seasonality" xlink:href="trex-20241231.xsd#Seasonality" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingencies" xlink:href="trex-20241231.xsd#CommitmentsAndContingencies" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReserves" xlink:href="trex-20241231.xsd#ScheduleIiValuationAndQualifyingAccountsAndReserves" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesPolicies" xlink:href="trex-20241231.xsd#SummaryOfSignificantAccountingPoliciesPolicies" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesTables" xlink:href="trex-20241231.xsd#SummaryOfSignificantAccountingPoliciesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/InventoriesTables" xlink:href="trex-20241231.xsd#InventoriesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsTables" xlink:href="trex-20241231.xsd#PrepaidExpensesAndOtherAssetsTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentTables" xlink:href="trex-20241231.xsd#PropertyPlantAndEquipmentTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesTables" xlink:href="trex-20241231.xsd#AccruedExpensesAndOtherLiabilitiesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesTables" xlink:href="trex-20241231.xsd#LeasesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityTables" xlink:href="trex-20241231.xsd#StockholdersEquityTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersTables" xlink:href="trex-20241231.xsd#RevenueFromContractsWithCustomersTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationTables" xlink:href="trex-20241231.xsd#StockBasedCompensationTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesTables" xlink:href="trex-20241231.xsd#IncomeTaxesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationTables" xlink:href="trex-20241231.xsd#SegmentInformationTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesTables" xlink:href="trex-20241231.xsd#CommitmentsAndContingenciesTables" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganizationAdditionalInformationDetail" xlink:href="trex-20241231.xsd#BusinessAndOrganizationAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" xlink:href="trex-20241231.xsd#SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail" xlink:href="trex-20241231.xsd#SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsIncAdditionalInformationDetail" xlink:href="trex-20241231.xsd#SaleOfTrexCommercialProductsIncAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/InventoriesSummaryOfInventoriesDetail" xlink:href="trex-20241231.xsd#InventoriesSummaryOfInventoriesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail" xlink:href="trex-20241231.xsd#PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" xlink:href="trex-20241231.xsd#GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail" xlink:href="trex-20241231.xsd#PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentAdditionalInformationDetail" xlink:href="trex-20241231.xsd#PropertyPlantAndEquipmentAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail" xlink:href="trex-20241231.xsd#AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DebtAdditionalInformationDetail" xlink:href="trex-20241231.xsd#DebtAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesAdditionalInformationDetail" xlink:href="trex-20241231.xsd#LeasesAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetail" xlink:href="trex-20241231.xsd#LeasesSupplementalCashFlowInformationToOperatingLeasesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail" xlink:href="trex-20241231.xsd#LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAdditionalInformationDetail" xlink:href="trex-20241231.xsd#StockholdersEquityAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail" xlink:href="trex-20241231.xsd#StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail" xlink:href="trex-20241231.xsd#StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail" xlink:href="trex-20241231.xsd#RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationAdditionalInformationDetail" xlink:href="trex-20241231.xsd#StockBasedCompensationAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail" xlink:href="trex-20241231.xsd#StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail" xlink:href="trex-20241231.xsd#DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail" xlink:href="trex-20241231.xsd#DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail" xlink:href="trex-20241231.xsd#StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSarActivityDetail" xlink:href="trex-20241231.xsd#StockBasedCompensationSarActivityDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlansAdditionalInformationDetail" xlink:href="trex-20241231.xsd#EmployeeBenefitPlansAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesIncomeTaxProvisionBenefitDetail" xlink:href="trex-20241231.xsd#IncomeTaxesIncomeTaxProvisionBenefitDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail" xlink:href="trex-20241231.xsd#IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail" xlink:href="trex-20241231.xsd#IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesAdditionalInformationDetail" xlink:href="trex-20241231.xsd#IncomeTaxesAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationAdditionalInformationDetail" xlink:href="trex-20241231.xsd#SegmentInformationAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/SegmentInformationDetailsOfSegmentInformationDetail" xlink:href="trex-20241231.xsd#SegmentInformationDetailsOfSegmentInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesAdditionalInformationDetail" xlink:href="trex-20241231.xsd#CommitmentsAndContingenciesAdditionalInformationDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail" xlink:href="trex-20241231.xsd#DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReservesDetail" xlink:href="trex-20241231.xsd#ScheduleIiValuationAndQualifyingAccountsAndReservesDetail" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.trex.com/20241231/taxonomy/role/DisclosureLeasesMaturitiesOfOperatingLeaseLiabilitiesDetail2" xlink:href="trex-20241231.xsd#DisclosureLeasesMaturitiesOfOperatingLeaseLiabilitiesDetail2" xlink:type="simple"/>
        <link:roleRef roleURI="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-roles-2024.xsd#eedm" xlink:type="simple"/>
        <link:roleRef roleURI="http://fasb.org/srt/role/srt-eedm/ExtensibleEnumerationLists" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-roles-2024.xsd#eedm1" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedLabel" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedLabel" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedTotalLabel" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedTotalLabel" xlink:type="simple"/>
        <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedTerseLabel" xlink:type="simple"/>
        <link:labelLink xlink:role="http://www.xbrl.org/2003/role/link" xlink:title="labelLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockRepurchaseProgramMember" xlink:label="trex_StockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandMember" xlink:label="us-gaap_LandMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:label="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentAxis" xlink:label="us-gaap_DebtInstrumentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerTwoMember" xlink:label="trex_CustomerTwoMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:label="us-gaap_IncreaseDecreaseInAccountsReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CapitalExpendituresInAccountsPayable" xlink:label="trex_CapitalExpendituresInAccountsPayable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" xlink:label="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsDeferredIncome" xlink:label="us-gaap_DeferredTaxAssetsDeferredIncome"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressPostalZipCode" xlink:label="dei_EntityAddressPostalZipCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:label="us-gaap_AssetsAndLiabilitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationNondeductibleExpense" xlink:label="us-gaap_IncomeTaxReconciliationNondeductibleExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityIncorporationStateCountryCode" xlink:label="dei_EntityIncorporationStateCountryCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestPaidNet" xlink:label="us-gaap_InterestPaidNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="us-gaap_IncomeTaxAuthorityNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherNoncashIncomeExpense" xlink:label="us-gaap_OtherNoncashIncomeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsInventory" xlink:label="us-gaap_DeferredTaxAssetsInventory"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:label="us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorName" xlink:label="dei_AuditorName"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OpenTaxYear" xlink:label="us-gaap_OpenTaxYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeasesTextBlock" xlink:label="us-gaap_LesseeOperatingLeasesTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LatestTaxYearMember" xlink:label="us-gaap_LatestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandFourteenStockIncentivePlanMember" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductOrServiceAxis" xlink:label="srt_ProductOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityAxis" xlink:label="us-gaap_LineOfCreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_EquityMethodInvesteeNameDomain" xlink:label="srt_EquityMethodInvesteeNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxCredits" xlink:label="us-gaap_IncomeTaxReconciliationTaxCredits"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="us-gaap_DepreciationDepletionAndAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BaseRateMember" xlink:label="us-gaap_BaseRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" xlink:label="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodShares" xlink:label="us-gaap_StockRepurchasedDuringPeriodShares"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfGoodwillTable" xlink:label="us-gaap_ScheduleOfGoodwillTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfTreasuryStockTable" xlink:label="us-gaap_ClassOfTreasuryStockTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:label="us-gaap_ConcentrationRiskByBenchmarkAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:label="us-gaap_StockholdersEquityNoteDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:label="us-gaap_RevenueFromContractWithCustomerTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentCarryingAmount" xlink:label="us-gaap_DebtInstrumentCarryingAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntersegmentEliminationMember" xlink:label="us-gaap_IntersegmentEliminationMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:label="us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryPolicyTextBlock" xlink:label="us-gaap_InventoryPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCentralIndexKey" xlink:label="dei_EntityCentralIndexKey"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorOpinionTextBlock" xlink:label="dei_AuditorOpinionTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ForkliftsAndTractorsMember" xlink:label="trex_ForkliftsAndTractorsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdvertisingExpense" xlink:label="us-gaap_AdvertisingExpense"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesIssued" xlink:label="us-gaap_CommonStockSharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StagingMember" xlink:label="trex_StagingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TrexCommercialProductsIncMember" xlink:label="trex_TrexCommercialProductsIncMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeStatementAbstract" xlink:label="us-gaap_IncomeStatementAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressStateOrProvince" xlink:label="dei_EntityAddressStateOrProvince"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingWarrantyReserveMember" xlink:label="trex_SurfaceFlakingWarrantyReserveMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="us-gaap_ConcentrationRiskTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityClassOfTreasuryStockLineItems" xlink:label="us-gaap_EquityClassOfTreasuryStockLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockAppreciationRightsMember" xlink:label="trex_StockAppreciationRightsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MajorCustomersAxis" xlink:label="srt_MajorCustomersAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" xlink:label="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CustomerConcentrationRiskMember" xlink:label="us-gaap_CustomerConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityExpirationDate1" xlink:label="us-gaap_LineOfCreditFacilityExpirationDate1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" xlink:label="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryRawMaterials" xlink:label="us-gaap_InventoryRawMaterials"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonShares" xlink:label="us-gaap_TreasuryStockCommonShares"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CoverAbstract" xlink:label="dei_CoverAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareBasic" xlink:label="us-gaap_EarningsPerShareBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyLineItems" xlink:label="us-gaap_IncomeTaxContingencyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingALoansMember" xlink:label="trex_RevolvingALoansMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyTable" xlink:label="us-gaap_IncomeTaxContingencyTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPayments" xlink:label="us-gaap_StandardProductWarrantyAccrualPayments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentAnnualReport" xlink:label="dei_DocumentAnnualReport"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AllocatedShareBasedCompensationExpense" xlink:label="us-gaap_AllocatedShareBasedCompensationExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdvertisingCostsPolicyTextBlock" xlink:label="us-gaap_AdvertisingCostsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInFourthYear" xlink:label="us-gaap_PurchaseObligationDueInFourthYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:label="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameAxis" xlink:label="us-gaap_PlanNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingAbstract" xlink:label="us-gaap_SegmentReportingAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingMember" xlink:label="trex_SignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyPolicy" xlink:label="us-gaap_StandardProductWarrantyPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsCurrentAbstract" xlink:label="us-gaap_AssetsCurrentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" xlink:label="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:label="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RawMaterialSupplyContractsMember" xlink:label="trex_RawMaterialSupplyContractsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryGross" xlink:label="us-gaap_InventoryGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodDomain" xlink:label="us-gaap_TaxPeriodDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsByNatureAxis" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingAxis" xlink:label="us-gaap_VestingAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockParOrStatedValuePerShare" xlink:label="us-gaap_CommonStockParOrStatedValuePerShare"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FifthAmendmentAndRestatedAgreementMember" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInSecondYear" xlink:label="us-gaap_PurchaseObligationDueInSecondYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfCashFlowsAbstract" xlink:label="us-gaap_StatementOfCashFlowsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesNameDomain" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockIssuedSharesEmployeeStockPurchasePlan" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOther" xlink:label="us-gaap_DeferredTaxAssetsOther"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RestrictedStockMember" xlink:label="us-gaap_RestrictedStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="us-gaap_StatementEquityComponentsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressAddressLine1" xlink:label="dei_EntityAddressAddressLine1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock" xlink:label="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityLineItems" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComputerEquipmentMember" xlink:label="us-gaap_ComputerEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:label="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="us-gaap_SubsequentEventTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrual" xlink:label="us-gaap_StandardProductWarrantyAccrual"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityVoluntaryFilers" xlink:label="dei_EntityVoluntaryFilers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfFinancialInstitutionWithDeposit" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AmendmentFlag" xlink:label="dei_AmendmentFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandEighteenStockRepurchaseProgramMember" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentFederalTaxExpenseBenefit" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TranscendDeckingMember" xlink:label="trex_TranscendDeckingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TextBlockAbstract" xlink:label="us-gaap_TextBlockAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LessorOperatingLeaseTermOfContract" xlink:label="us-gaap_LessorOperatingLeaseTermOfContract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="us-gaap_DebtInstrumentNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalCommonStock" xlink:label="us-gaap_AdditionalPaidInCapitalCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList" xlink:label="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" xlink:label="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateDomain" xlink:label="us-gaap_VariableRateDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedContributionPlanCostRecognized" xlink:label="us-gaap_DefinedContributionPlanCostRecognized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_NameOfMajorCustomerDomain" xlink:label="srt_NameOfMajorCustomerDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" xlink:label="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFinStmtErrorCorrectionFlag" xlink:label="dei_DocumentFinStmtErrorCorrectionFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FurnitureAndFixturesMember" xlink:label="us-gaap_FurnitureAndFixturesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:label="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonMember" xlink:label="us-gaap_TreasuryStockCommonMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueTable" xlink:label="us-gaap_DisaggregationOfRevenueTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" xlink:label="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedFlag" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromLinesOfCredit" xlink:label="us-gaap_ProceedsFromLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProfitLoss" xlink:label="us-gaap_ProfitLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesIssued" xlink:label="us-gaap_PreferredStockSharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeasePayments" xlink:label="us-gaap_OperatingLeasePayments"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PayablesAndAccrualsAbstract" xlink:label="us-gaap_PayablesAndAccrualsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsAxis" xlink:label="srt_ConsolidationItemsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredOverTimeMember" xlink:label="us-gaap_TransferredOverTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductWarrantyMember" xlink:label="trex_ProductWarrantyMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesOutstanding" xlink:label="us-gaap_CommonStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FairValueMeasurementPolicyPolicyTextBlock" xlink:label="us-gaap_FairValueMeasurementPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeExpenseNet" xlink:label="us-gaap_InterestIncomeExpenseNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationByTypeAxis" xlink:label="us-gaap_ContingentConsiderationByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:label="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockParOrStatedValuePerShare" xlink:label="us-gaap_PreferredStockParOrStatedValuePerShare"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SalesRevenueNetMember" xlink:label="us-gaap_SalesRevenueNetMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesDepreciation" xlink:label="trex_DeferredTaxLiabilitiesDepreciation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:label="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RepaymentsOfLinesOfCredit" xlink:label="us-gaap_RepaymentsOfLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationOtherAdjustments" xlink:label="us-gaap_IncomeTaxReconciliationOtherAdjustments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:label="us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityInteractiveDataCurrent" xlink:label="dei_EntityInteractiveDataCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="us-gaap_TypeOfAdoptionMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillLineItems" xlink:label="us-gaap_GoodwillLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostOfGoodsAndServicesSold" xlink:label="us-gaap_CostOfGoodsAndServicesSold"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseCost" xlink:label="us-gaap_OperatingLeaseCost"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityPolicyTextBlock" xlink:label="us-gaap_StockholdersEquityPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingencyNatureDomain" xlink:label="us-gaap_GainContingencyNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LineOfCreditFacilityAdditionalBorrowingCapacity" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:label="us-gaap_DisaggregationOfRevenueTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock" xlink:label="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="us-gaap_MachineryAndEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResearchAndDevelopmentExpensePolicy" xlink:label="us-gaap_ResearchAndDevelopmentExpensePolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets" xlink:label="us-gaap_Assets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodAxis" xlink:label="us-gaap_TaxPeriodAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilities" xlink:label="us-gaap_DeferredIncomeTaxLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemDomain" xlink:label="us-gaap_UnusualOrInfrequentItemDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:label="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressCityOrTown" xlink:label="dei_EntityAddressCityOrTown"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsOperatingLeaseLiabilities" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorLocation" xlink:label="dei_AuditorLocation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock" xlink:label="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesBalance" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" xlink:label="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Depreciation" xlink:label="us-gaap_Depreciation"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesGoodwillAmortization" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLossAbstract" xlink:label="us-gaap_NetIncomeLossAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" xlink:label="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConstructionInProgressMember" xlink:label="us-gaap_ConstructionInProgressMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:label="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfLargestRawMaterialSuppliers" xlink:label="trex_NumberOfLargestRawMaterialSuppliers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" xlink:label="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternetDomainNamesMember" xlink:label="us-gaap_InternetDomainNamesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityPublicFloat" xlink:label="dei_EntityPublicFloat"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsNet" xlink:label="us-gaap_DeferredTaxAssetsNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplierConcentrationRiskMember" xlink:label="us-gaap_SupplierConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrentAbstract" xlink:label="us-gaap_LiabilitiesCurrentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FourLargestSuppliersMember" xlink:label="trex_FourLargestSuppliersMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GrossAssetAndLiability" xlink:label="trex_GrossAssetAndLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableMember" xlink:label="us-gaap_AccountsReceivableMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxesPaidNet" xlink:label="us-gaap_IncomeTaxesPaidNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentType" xlink:label="dei_DocumentType"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:label="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_Security12bTitle" xlink:label="dei_Security12bTitle"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:label="us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:label="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfStockholdersEquityAbstract" xlink:label="us-gaap_StatementOfStockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFiscalPeriodFocus" xlink:label="dei_DocumentFiscalPeriodFocus"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResearchAndDevelopmentExpense" xlink:label="us-gaap_ResearchAndDevelopmentExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarliestTaxYearMember" xlink:label="us-gaap_EarliestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueAbstract" xlink:label="us-gaap_DisaggregationOfRevenueAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingAndBuildingImprovementsMember" xlink:label="us-gaap_BuildingAndBuildingImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeLeasesPolicyTextBlock" xlink:label="us-gaap_LesseeLeasesPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingSegmentsMember" xlink:label="us-gaap_OperatingSegmentsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" xlink:label="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneAxis" xlink:label="trex_CreditFacilityOneAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxSettlements" xlink:label="us-gaap_IncomeTaxReconciliationTaxSettlements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:label="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" xlink:label="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureTextBlock" xlink:label="us-gaap_IncomeTaxDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:label="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLineItems" xlink:label="us-gaap_LineOfCreditFacilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodValue" xlink:label="us-gaap_StockRepurchasedDuringPeriodValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityDomain" xlink:label="us-gaap_CreditFacilityDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAccruedLiabilitiesCurrent" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsPayable" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:label="us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentPeriodEndDate" xlink:label="dei_DocumentPeriodEndDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NonRule10B51ArrModifiedFlag" xlink:label="trex_NonRule10B51ArrModifiedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_IcfrAuditorAttestationFlag" xlink:label="dei_IcfrAuditorAttestationFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityNoteAbstract" xlink:label="us-gaap_StockholdersEquityNoteAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SelectDeckingAndUniversalFasciaMember" xlink:label="trex_SelectDeckingAndUniversalFasciaMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInThirdYear" xlink:label="us-gaap_PurchaseObligationDueInThirdYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialAndCommercialUseMember" xlink:label="trex_ResidentialAndCommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" xlink:label="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameAxis" xlink:label="us-gaap_IncomeTaxAuthorityNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:label="us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:label="us-gaap_ComponentsOfDeferredTaxAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_TradingSymbol" xlink:label="dei_TradingSymbol"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RailingMember" xlink:label="trex_RailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:label="us-gaap_CashFlowOperatingActivitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateAxis" xlink:label="us-gaap_VariableRateAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsAbstract" xlink:label="srt_ValuationAndQualifyingAccountsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" xlink:label="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxesReceivable" xlink:label="us-gaap_IncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsGross" xlink:label="us-gaap_DeferredTaxAssetsGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherLiabilitiesNoncurrent" xlink:label="us-gaap_OtherLiabilitiesNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:label="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_Rule10B51ArrModifiedFlag" xlink:label="trex_Rule10B51ArrModifiedFlag"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_IndustrialRevenueBondsMember" xlink:label="trex_IndustrialRevenueBondsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EBITDA" xlink:label="trex_EBITDA"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Goodwill" xlink:label="us-gaap_Goodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtWeightedAverageInterestRate" xlink:label="us-gaap_DebtWeightedAverageInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramAxis" xlink:label="srt_ShareRepurchaseProgramAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NatureOfOperations" xlink:label="us-gaap_NatureOfOperations"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AreaOfLand" xlink:label="us-gaap_AreaOfLand"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SwinglineLetterOfCreditMember" xlink:label="trex_SwinglineLetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UseOfEstimates" xlink:label="us-gaap_UseOfEstimates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskPercentage1" xlink:label="us-gaap_ConcentrationRiskPercentage1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:label="us-gaap_CashAndCashEquivalentsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedMarketingCostsCurrent" xlink:label="us-gaap_AccruedMarketingCostsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementDomain" xlink:label="trex_AgreementDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneDomain" xlink:label="trex_CreditFacilityOneDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_SecurityExchangeName" xlink:label="dei_SecurityExchangeName"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_OtherResidentialMember" xlink:label="trex_OtherResidentialMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InvestmentsAllOtherInvestmentsAbstract" xlink:label="us-gaap_InvestmentsAllOtherInvestmentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsGrossExcludingGoodwill" xlink:label="us-gaap_IntangibleAssetsGrossExcludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseCurrent" xlink:label="us-gaap_PrepaidExpenseCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplementalCashFlowInformationAbstract" xlink:label="us-gaap_SupplementalCashFlowInformationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:label="us-gaap_CompensationAndRetirementDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingBLoanMember" xlink:label="trex_RevolvingBLoanMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareDiluted" xlink:label="us-gaap_EarningsPerShareDiluted"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeaseholdImprovementsMember" xlink:label="us-gaap_LeaseholdImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Liabilities" xlink:label="us-gaap_Liabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsCurrent" xlink:label="us-gaap_AssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:label="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnrecognizedTaxBenefits" xlink:label="us-gaap_UnrecognizedTaxBenefits"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeOperating" xlink:label="us-gaap_InterestIncomeOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityFilerCategory" xlink:label="dei_EntityFilerCategory"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentAbstract" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CommercialUseMember" xlink:label="trex_CommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_InsuranceProceedsPolicyTextBlock" xlink:label="trex_InsuranceProceedsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityLineItems" xlink:label="us-gaap_ProductWarrantyLiabilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PaymentsForProceedsFromFinancingCosts" xlink:label="trex_PaymentsForProceedsFromFinancingCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CurrentFiscalYearEndDate" xlink:label="dei_CurrentFiscalYearEndDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandAndLandImprovements" xlink:label="us-gaap_LandAndLandImprovements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensation" xlink:label="us-gaap_ShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityRegistrantName" xlink:label="dei_EntityRegistrantName"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GrossProfit" xlink:label="us-gaap_GrossProfit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NumberOfReportableSegments" xlink:label="us-gaap_NumberOfReportableSegments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentMaturityDate" xlink:label="us-gaap_DebtInstrumentMaturityDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityEmergingGrowthCompany" xlink:label="dei_EntityEmergingGrowthCompany"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccountingPoliciesTable" xlink:label="trex_AccountingPoliciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquireIntangibleAssets" xlink:label="us-gaap_PaymentsToAcquireIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingDomain" xlink:label="us-gaap_VestingDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:label="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:label="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_WarrantyPeriod" xlink:label="trex_WarrantyPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesAuthorized" xlink:label="us-gaap_CommonStockSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramDomain" xlink:label="srt_ShareRepurchaseProgramDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByTypeAxis" xlink:label="us-gaap_ConcentrationRiskByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDeductions" xlink:label="us-gaap_ValuationAllowancesAndReservesDeductions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" xlink:label="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtDisclosureAbstract" xlink:label="us-gaap_DebtDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentsIncorporatedByReferenceTextBlock" xlink:label="dei_DocumentsIncorporatedByReferenceTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" xlink:label="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock" xlink:label="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AmortizationOfIntangibleAssets" xlink:label="us-gaap_AmortizationOfIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueRecognitionPolicyTextBlock" xlink:label="us-gaap_RevenueRecognitionPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CapitalExpenditure" xlink:label="trex_CapitalExpenditure"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="us-gaap_GoodwillImpairmentLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskRoleOfManagementTextBlock" xlink:label="cyd_CybersecurityRiskRoleOfManagementTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentAxis" xlink:label="us-gaap_SupplyCommitmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCredit" xlink:label="us-gaap_LineOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InsuranceSettlementMember" xlink:label="us-gaap_InsuranceSettlementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityAbstract" xlink:label="us-gaap_StockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentArrangementMember" xlink:label="us-gaap_SupplyCommitmentArrangementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract" xlink:label="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesAuthorized" xlink:label="us-gaap_PreferredStockSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityFileNumber" xlink:label="dei_EntityFileNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingDisclosureTextBlock" xlink:label="us-gaap_SegmentReportingDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerAbstract" xlink:label="us-gaap_RevenueFromContractWithCustomerAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredAtPointInTimeMember" xlink:label="us-gaap_TransferredAtPointInTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditAgreementSecondAmendmentMember" xlink:label="trex_CreditAgreementSecondAmendmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureAbstract" xlink:label="us-gaap_InventoryDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfFinancialPositionAbstract" xlink:label="us-gaap_StatementOfFinancialPositionAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingIncomeLoss" xlink:label="us-gaap_OperatingIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestExpenseOperating" xlink:label="us-gaap_InterestExpenseOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedIncomeTaxesCurrent" xlink:label="us-gaap_AccruedIncomeTaxesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LetterOfCreditMember" xlink:label="us-gaap_LetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityShellCompany" xlink:label="dei_EntityShellCompany"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityTable" xlink:label="us-gaap_LineOfCreditFacilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityTaxIdentificationNumber" xlink:label="dei_EntityTaxIdentificationNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsAbstract" xlink:label="us-gaap_AssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfSalesRetailers" xlink:label="trex_NumberOfSalesRetailers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:label="us-gaap_FairValueOfFinancialInstrumentsPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCurrentReportingStatus" xlink:label="dei_EntityCurrentReportingStatus"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedManufacturingExpensesCurrent" xlink:label="trex_AccruedManufacturingExpensesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WarrantyReservesMember" xlink:label="us-gaap_WarrantyReservesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SoftwareDevelopmentMember" xlink:label="us-gaap_SoftwareDevelopmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:label="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureTextBlock" xlink:label="us-gaap_InventoryDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFiscalYearFocus" xlink:label="dei_DocumentFiscalYearFocus"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockValue" xlink:label="us-gaap_PreferredStockValue"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CityAreaCode" xlink:label="dei_CityAreaCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrent" xlink:label="us-gaap_LiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SeasonalityDisclosureTextBlock" xlink:label="trex_SeasonalityDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="us-gaap_LineOfCreditFacilityLenderDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LIFOInventoryAmount" xlink:label="us-gaap_LIFOInventoryAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryNet" xlink:label="us-gaap_InventoryNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityTable" xlink:label="us-gaap_ProductWarrantyLiabilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryFinishedGoods" xlink:label="us-gaap_InventoryFinishedGoods"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" xlink:label="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract" xlink:label="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_LocalPhoneNumber" xlink:label="dei_LocalPhoneNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesOutstanding" xlink:label="us-gaap_PreferredStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxPolicyTextBlock" xlink:label="us-gaap_IncomeTaxPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesIssued" xlink:label="us-gaap_SharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockValue" xlink:label="us-gaap_TreasuryStockValue"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerOneMember" xlink:label="trex_CustomerOneMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:label="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualNoncurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GainLossOnInsuranceSettlement" xlink:label="trex_GainLossOnInsuranceSettlement"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityCurrent" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PublicUtilitiesInventoryRawMaterialsMember" xlink:label="us-gaap_PublicUtilitiesInventoryRawMaterialsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage" xlink:label="us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsMember" xlink:label="us-gaap_RetainedEarningsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentTransitionReport" xlink:label="dei_DocumentTransitionReport"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PostemploymentBenefitsAbstract" xlink:label="us-gaap_PostemploymentBenefitsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedCapitalProjectsCurrent" xlink:label="trex_AccruedCapitalProjectsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskCreditRisk" xlink:label="us-gaap_ConcentrationRiskCreditRisk"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorFirmId" xlink:label="dei_AuditorFirmId"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockMember" xlink:label="us-gaap_CommonStockMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EmployeeStockPurchasePlanMember" xlink:label="trex_EmployeeStockPurchasePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:label="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalMember" xlink:label="us-gaap_AdditionalPaidInCapitalMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityWellKnownSeasonedIssuer" xlink:label="dei_EntityWellKnownSeasonedIssuer"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesInventoriesAndOther" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitAxis" xlink:label="us-gaap_ReportingUnitAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsNoncurrent" xlink:label="us-gaap_OtherAssetsNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DescriptionOfOperatingLeasesWithInitialTerm" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidAdvertising" xlink:label="us-gaap_PrepaidAdvertising"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:label="us-gaap_ScheduleOfInventoryCurrentTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingAndTranscendCladdingMember" xlink:label="trex_SignatureRailingAndTranscendCladdingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsCurrent" xlink:label="us-gaap_OtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCommonStockSharesOutstanding" xlink:label="dei_EntityCommonStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancialInstrumentsDisclosureTextBlock" xlink:label="us-gaap_FinancialInstrumentsDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueLineItems" xlink:label="us-gaap_DisaggregationOfRevenueLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BasisOfAccountingPolicyPolicyTextBlock" xlink:label="us-gaap_BasisOfAccountingPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" xlink:label="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockValue" xlink:label="us-gaap_CommonStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LinesOfCreditCurrent" xlink:label="us-gaap_LinesOfCreditCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnDispositionOfAssets1" xlink:label="us-gaap_GainLossOnDispositionOfAssets1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerThreeMember" xlink:label="trex_CustomerThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityTable" xlink:label="trex_ScheduleOfRestrictedStockActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingencies" xlink:label="us-gaap_CommitmentsAndContingencies"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualCurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableNetCurrent" xlink:label="us-gaap_AccountsReceivableNetCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInInventories" xlink:label="us-gaap_IncreaseDecreaseInInventories"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" xlink:label="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FireAtVirginiaFacilityMember" xlink:label="trex_FireAtVirginiaFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_MaturityPeriodOfCashEquivalent" xlink:label="trex_MaturityPeriodOfCashEquivalent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntitySmallBusiness" xlink:label="dei_EntitySmallBusiness"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" xlink:label="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="us-gaap_SegmentReportingInformationLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:label="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtDisclosureTextBlock" xlink:label="us-gaap_DebtDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockSharesAcquired" xlink:label="us-gaap_TreasuryStockSharesAcquired"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:label="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityAxis" xlink:label="us-gaap_CreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="us-gaap_RevolvingCreditFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryLIFOReserve" xlink:label="us-gaap_InventoryLIFOReserve"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SupplementalBalanceSheetInformationAbstract" xlink:label="trex_SupplementalBalanceSheetInformationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternalRevenueServiceIRSMember" xlink:label="us-gaap_InternalRevenueServiceIRSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock" xlink:label="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemAxis" xlink:label="us-gaap_UnusualOrInfrequentItemAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" xlink:label="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementAxis" xlink:label="trex_AgreementAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" xlink:label="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingenciesByNatureAxis" xlink:label="us-gaap_GainContingenciesByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialUseMember" xlink:label="trex_ResidentialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingMember" xlink:label="trex_SurfaceFlakingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:label="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsPayableCurrent" xlink:label="us-gaap_AccountsPayableCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" xlink:label="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingMember" xlink:label="us-gaap_BuildingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DomainNamesAndInternalUseSoftwareMember" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PresidentAndChiefExecutiveOfficerMember" xlink:label="trex_PresidentAndChiefExecutiveOfficerMember"/>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statement [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Statement [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">stock repurchase program.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Repurchase Program [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock Repurchase Programs [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LandMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Land [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LandMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Land [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Incremental Weighted Average Shares Attributable to Dilutive Effect [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Effect of dilutive securities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt Instrument [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Board of Directors Oversight [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerTwoMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Customer two.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerTwoMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer Two [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerTwoMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer Two [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccountsReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Accounts Receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccountsReceivable_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Accounts receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PlanNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Plan Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PlanNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Plan Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpendituresInAccountsPayable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Capital expenditures in accounts payable.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpendituresInAccountsPayable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Capital Expenditures In Accounts Payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpendituresInAccountsPayable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Capital expenditures in accounts payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation at Federal Statutory Income Tax Rate, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">U.S. Federal statutory taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsDeferredIncome_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Deferred Income</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsDeferredIncome_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred revenue</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Adjustments Related to Tax Withholding for Share-based Compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Shares withheld for taxes on awards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityAddressPostalZipCode_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Address, Postal Zip Code</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Board Committee or Subcommittee Responsible for Oversight [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsAndLiabilitiesLesseeAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Assets and Liabilities, Lessee [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsAndLiabilitiesLesseeAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating lease liabilities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationNondeductibleExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Nondeductible Expense, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationNondeductibleExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Permanent items</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityIncorporationStateCountryCode_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Incorporation, State or Country Code</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestPaidNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Interest Paid, Excluding Capitalized Interest, Operating Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestPaidNet_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Cash paid for interest, net of capitalized interest</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Employee Service Share-based Compensation, Nonvested Awards, Compensation Not yet Recognized, Share-based Awards Other than Options</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Unrecognized compensation cost related to unvested awards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Maximum Employee Subscription Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Percentage of gross compensation eligible employees may elect to participate in the plan</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxAuthorityNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Authority, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherNoncashIncomeExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Noncash Income (Expense)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherNoncashIncomeExpense_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Other non-cash adjustments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsInventory_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Inventory</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsInventory_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Unrecognized tax benefits number of tax matters identified</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Unrecognized Tax Benefits Number Of Tax Matters Identified</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Unrecognized tax benefits number of tax matters</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntangibleAssetsNetIncludingGoodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Intangible Assets, Net (Including Goodwill)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntangibleAssetsNetIncludingGoodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Goodwill and other intangible assets, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AuditorName_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Auditor Name</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Federal Income Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Federal</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Share-based Compensation Arrangement by Share-based Payment Award [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OpenTaxYear_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Open Tax Year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OpenTaxYear_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Tax years subject to examination</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeasesTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Leases [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeasesTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Leases</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Commitments and Contingencies Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Commitments and Contingencies</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LatestTaxYearMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Latest Tax Year [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Two Thousand Fourteen Stock Incentive Plan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Two Thousand Fourteen Stock Incentive Plan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">2014 Stock Incentive Plan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ProductOrServiceAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Product and Service [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Income Tax Liabilities, Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred income taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTotalLabel">Net deferred tax liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Finite-Lived Intangible Assets by Major Class [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Finite-Lived Intangible Assets by Major Class [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lender Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_EquityMethodInvesteeNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Investment, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_EquityMethodInvesteeNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Investment, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationTaxCredits_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Tax Credit, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationTaxCredits_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Federal credits</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DepreciationDepletionAndAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Depreciation, Depletion and Amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DepreciationDepletionAndAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Depreciation and amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DepreciationDepletionAndAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Depreciation and Amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BaseRateMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Base Rate [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BaseRateMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Base Rate [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Adjustments, Noncash Items, to Reconcile Net Income (Loss) to Cash Provided by (Used in) Operating Activities [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Adjustments to reconcile net income to net cash provided by operating activities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Tabular disclosure pertaining to prepaid expense and other assets current.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid Expense And Other Assets Current [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Prepaid Expenses and Other Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockRepurchasedDuringPeriodShares_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Repurchased During Period, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockRepurchasedDuringPeriodShares_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock repurchased during period, shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfGoodwillTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Goodwill [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfGoodwillTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Goodwill [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ClassOfTreasuryStockTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Class of Treasury Stock [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ClassOfTreasuryStockTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Class of Treasury Stock [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Processes Integrated [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskByBenchmarkAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk Benchmark [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskByBenchmarkAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentration Risk Benchmark [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityNoteDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stockholders' Equity Note Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityNoteDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stockholders' Equity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Sharebased compensation arrangement by sharebased payment award non options vested and expected to vest outstanding weighted average remaining contractual term.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Sharebased Compensation Arrangement by Sharebased Payment Award Non Options Vested and Expected to Vest Outstanding Weighted Average Remaining Contractual Term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted Average Remaining Contractual Life, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revenue from Contract with Customer [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revenue From Contracts With Customers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Products sold on or after january&#160;one, two thousand and twenty three [Member].</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Products Sold on or After January One, Two Thousand and Twenty Three [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Sharebased compensation arrangement by sharebased payment award non options exercisable weighted average remaining contractual term.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Sharebased Compensation Arrangement by Sharebased Payment Award Non Options Exercisable Weighted Average Remaining Contractual Term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted Average Remaining Contractual Life, Exercisable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Issued During Period, Value, Share-based Compensation, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-based compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentCarryingAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Long-Term Debt, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentCarryingAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Bonds issue</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility, Remaining Borrowing Capacity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Remaining available borrowing capacity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntersegmentEliminationMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Intersegment Eliminations [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntersegmentEliminationMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Intercompany Net Sales [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetUsefulLife_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Finite-Lived Intangible Asset, Useful Life</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetUsefulLife_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Amortization period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityCentralIndexKey_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Central Index Key</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AuditorOpinionTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Auditor Opinion</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AuditorOpinionTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Auditor Opinion [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ForkliftsAndTractorsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Forklifts and tractors.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ForkliftsAndTractorsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Forklifts And Tractors [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ForkliftsAndTractorsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Forklifts and Tractors [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdvertisingExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Advertising Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdvertisingExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Branding Expenses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of business days with in which lender may raise objections to amendment.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Business Days Within Which Lender May Raise Objections To Amendment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number Of Business Days Within Which Lender May Raise Objections To Amendment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Shares, Issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock, shares issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StagingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Staging.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StagingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Staging [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Prepaid Expense and Other Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Prepaid expenses and other assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TrexCommercialProductsIncMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Trex commercial products inc.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TrexCommercialProductsIncMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Trex Commercial Products Inc [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TrexCommercialProductsIncMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Trex Commercial Products Inc [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeStatementAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Statement [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Share-based Compensation, Stock Appreciation Rights Award Activity [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">SAR Activity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityAddressStateOrProvince_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Address, State or Province</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income (Loss) from Continuing Operations before Income Taxes, Noncontrolling Interest</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Income before income taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingWarrantyReserveMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Surface Flaking Warranty Reserve [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingWarrantyReserveMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Surface Flaking Warranty Reserve [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingWarrantyReserveMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Surface Flaking Warranty Reserve [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentration Risk Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EquityClassOfTreasuryStockLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Equity, Class of Treasury Stock [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EquityClassOfTreasuryStockLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Equity, Class of Treasury Stock [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockAppreciationRightsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Appreciation Rights [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockAppreciationRightsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Stock appreciation rights [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MajorCustomersAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MajorCustomersAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of reconciliation of net income to EBITDA.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Reconciliation Of Net Income To EBITDA [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Reconciliation of Net Income to EBITDA</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CustomerConcentrationRiskMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer Concentration Risk [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CustomerConcentrationRiskMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer Concentration Risk [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityExpirationDate1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility, Expiration Date</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityExpirationDate1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Termination date of the Credit Agreement</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Estimated change in the warranty reserve resulting from a 10% change in the expected number of remaining claims to be settled with payment or the expected cost to settle claims for disclosure purposes only.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Sensitivity Change In Surface Flaking Warranty Reserve</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Change in warranty reserve for disclosure purposes only</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Tabular disclosure of the estimated useful life of long-lived, physical assets that are used in the normal conduct of business to produce goods and services and not intended for resale.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property Plant And Equipment Estimated Useful Life [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Estimated Useful Lives of Property Plant and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule Of Commitments And Contingencies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Commitments And Contingencies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Commitments And Contingencies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryRawMaterials_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, Raw Materials, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryRawMaterials_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Raw materials</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockCommonShares_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Treasury Stock, Common, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockCommonShares_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Treasury stock, shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_CoverAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cover [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Earnings Per Share, Basic</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Basic earnings per common share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Basic earnings per share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxContingencyLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Contingency [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxContingencyLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Tax Contingency [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RevolvingALoansMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revolving A Loans [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RevolvingALoansMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Revolving A loans.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxContingencyTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Contingency [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxContingencyTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Tax Contingency [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualPayments_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty Accrual, Decrease for Payments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualPayments_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Settlements made during the period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Timing of Transfer of Good or Service [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Timing of Transfer of Good or Service [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments exercised weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Exercised Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Exercised, Weighted Average Grant Price Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentAnnualReport_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Annual Report</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ConsolidationItemsDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Consolidation Items [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ConsolidationItemsDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Consolidation Items [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share Based Compensation Arrangement by Share Based Payment Award Fair Value Assumptions and Methodology [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement by Share Based Payment Award Fair Value Assumptions and Methodology [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Share Based Compensation Arrangement by Share Based Payment Award Fair Value Assumptions and Methodology [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AllocatedShareBasedCompensationExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Allocated Share-based Compensation Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AllocatedShareBasedCompensationExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-based compensation expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdvertisingCostsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Advertising Costs, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdvertisingCostsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Advertising Costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInFourthYear_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Purchase Obligation, Due in Fourth Year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInFourthYear_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Purchase commitment, due in fourth year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Non-Option Equity Instruments, Outstanding, Number</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Shares Outstanding, SARs, Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">SARs Outstanding, Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Nonvested Restricted Stock Shares Activity [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Restricted Stock Unit Activity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Retained Earnings (Accumulated Deficit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Retained earnings</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PlanNameAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Plan Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PlanNameAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Plan Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Segment Reporting [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SignatureRailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Signature railing [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SignatureRailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Signature Railing [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SignatureRailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Signature Railing [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Product Warranty</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsCurrentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Assets, Current [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsCurrentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Current Assets:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Capital Shares Reserved for Future Issuance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Number of common stock available for future issuance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Defined Benefit Plans Disclosures [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Defined Benefit Plans Disclosures [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of stock appreciation rights activity.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Stock Appreciation Rights Activity [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Stock Appreciation Rights Activity [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Operating Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Net cash provided by operating activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RawMaterialSupplyContractsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Raw material supply contracts.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RawMaterialSupplyContractsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Raw Material Supply Contracts [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RawMaterialSupplyContractsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Raw Material Supply Contracts [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Forfeitures, Weighted Average Grant Date Fair Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted-Average Grant Price Per Share, Forfeited</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ProductsAndServicesDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Product and Service [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Outstanding, Weighted Average Remaining Contractual Terms</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted Average Remaining Contractual Life, Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryGross_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryGross_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total FIFO (first-in, first-out) inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TaxPeriodDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Tax Period [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentNet_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, plant and equipment, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentNet_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total property, plant and equipment, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due Year Four</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2028</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Operating Activities [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Operating Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Guarantor Obligations, Nature [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Guarantor Obligations, Nature [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Current Income Tax Expense (Benefit), Continuing Operations [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Current income tax provision:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VestingAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Vesting [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VestingAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Vesting [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockParOrStatedValuePerShare_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Par or Stated Value Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockParOrStatedValuePerShare_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock, par value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Positions or Committees Responsible [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Fifth amendment and restated agreement member.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Fifth Amendment And Restated Agreement [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Fifth Amendment And Restated Agreement [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInSecondYear_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Purchase Obligation, Due in Second Year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInSecondYear_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Purchase commitment, due in second year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Timing of Transfer of Good or Service [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Timing of Transfer of Good or Service [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementOfCashFlowsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statement of Cash Flows [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Antidilutive Securities, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Antidilutive Securities, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of shares issued since the plan's inception as a result of an employee stock purchase plan.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Issued Shares Employee Stock Purchase Plan</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Approximate number of shares employees purchased under the Employee Stock Purchase Plan</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsOther_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsOther_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accruals not currently deductible and other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RestrictedStockMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Restricted Stock [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RestrictedStockMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Restricted stock [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementEquityComponentsAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Equity Components [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementEquityComponentsAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Equity Components [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityAddressAddressLine1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Address, Address Line One</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Enhance decking and transcend, select, enhance and signature railing.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Enhance Decking And Transcend, Select, Enhance And Signature Railing [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Tax Deferred Expense, Reserves and Accruals, Warranty Reserves</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Product and surface flaking warranty reserves</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Earnings Per Share, Basic and Diluted [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Computation of Basic and Diluted Earnings Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Employee-related Liabilities, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Compensation and benefits</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of restricted stock activity.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Restricted Stock Activity [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Restricted Stock Activity [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Grants in Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Performance-based Restricted Stock, Granted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Time-based Restricted Stock, Granted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Process for Informing Board Committee or Subcommittee Responsible for Oversight [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComputerEquipmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Computer Equipment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComputerEquipmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Computer Equipment and Software [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComputerEquipmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Computer Equipment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowances and Reserves, Additions, Charge to Cost and Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Additions Charged to Cost and Expenses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SubsequentEventTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Subsequent Event Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SubsequentEventTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Subsequent Event Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Income Tax Expense (Benefit), Continuing Operations [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred income tax provision:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Antidilutive Securities Excluded from Computation of Earnings Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">With respect to each vesting, the number of shares that will vest stated as a percentage of the target number of shares.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement By Share-based Payment Award Award Vesting Rights Percentage To Target Number Of Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Percentage of target number of shares that will vest</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility, Maximum Borrowing Capacity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revolving loans in a collective maximum principal amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Risk Free Interest Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Average risk-free interest rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrual_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty Accrual</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrual_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Ending balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrual_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Beginning balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Number</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Nonvested, Shares, Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Nonvested, Shares, Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityVoluntaryFilers_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Voluntary Filers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Subsidiary or Equity Method Investee [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of financial institutions where Company deposits are maintained.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Financial Institution With Deposit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of financial institutions where deposits are maintained</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AmendmentFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Amendment Flag</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Current Income Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Two Thousand Eighteen Stock Repurchase Program [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Two thousand eighteen stock repurchase program.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2018 Stock Repurchase Program [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Current Federal Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Federal</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Liability, Noncurrent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TranscendDeckingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Transcend decking.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TranscendDeckingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Transcend Decking [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TextBlockAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Text Block [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LessorOperatingLeaseTermOfContract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessor, Operating Lease, Term of Contract</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LessorOperatingLeaseTermOfContract_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating Lease terms</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt Instrument, Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdditionalPaidInCapitalCommonStock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Additional Paid in Capital, Common Stock</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdditionalPaidInCapitalCommonStock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Additional paid-in capital</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Liability, Current, Statement of Financial Position [Extensible List]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Secured Overnight Financing Rate (SOFR) Overnight Index Swap Rate [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Secured Overnight Financing Rate (SOFR) Overnight Index Swap Rate [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetIncomeLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Net income</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetIncomeLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Net income</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VariableRateDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Variable Rate [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VariableRateDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Variable Rate [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DefinedContributionPlanCostRecognized_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Defined Contribution Plan, Cost</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DefinedContributionPlanCostRecognized_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Employer's contribution</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_NameOfMajorCustomerDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_NameOfMajorCustomerDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Table includes supplemental cash flow information and supplemental balance sheet information related to operating leases</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplemental Financial Information Of Operating Leases [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Supplemental Cash Flow information and Supplemental balance sheet information related to operating leases to operating leases</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EquityComponentDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Equity Component [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EquityComponentDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Equity Component [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_RangeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statistical Measurement [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_RangeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Range [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentFinStmtErrorCorrectionFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Financial Statement Error Correction [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Proceeds from Sale of Property, Plant, and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Proceeds from sales of property, plant and equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Represents accrued expenses and other current liabilities of operating leases</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee Operating leases Accrued Expenses And Other Current Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Accrued expenses and other current liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred State and Local Income Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">State</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Materially Affected or Reasonably Likely to Materially Affect Registrant [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FurnitureAndFixturesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Furniture and Fixtures [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FurnitureAndFixturesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Furniture and Fixtures [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Components of Deferred Tax Liabilities [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred tax liabilities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockCommonMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Treasury Stock, Common [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockCommonMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Treasury Stock [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disaggregation of Revenue [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Disaggregation of Revenue [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of commitments and contingencies.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Commitments And Contingencies [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Commitments And Contingencies [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty Accrual, Increase (Decrease) for Preexisting Warranties</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Provisions and changes in estimates</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Time based restricted stock and time based restricted stock units.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Time Based Restricted Stock And Time Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Time-Based Restricted Stock and Time-Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Processes Integrated [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromLinesOfCredit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Proceeds from Lines of Credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromLinesOfCredit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Borrowings under line of credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProfitLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Income (Loss), Including Portion Attributable to Noncontrolling Interest</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProfitLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Net income</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Financing Receivable Portfolio Segment [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Financing Receivable Portfolio Segment [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Preferred Stock, Shares Issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Preferred stock, shares issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeasePayments_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Payments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeasePayments_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Cash paid for amounts included in the measurement of operating lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments outstanding weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Outstanding Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Outstanding, Weighted Average Grant Price Per Share, Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Outstanding, Weighted Average Grant Price Per Share, Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of significant accounting policies.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Significant Accounting Policies [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Significant Accounting Policies [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PayablesAndAccrualsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Payables and Accruals [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ConsolidationItemsAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Consolidation Items [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ConsolidationItemsAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Consolidation Items [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Equity Award [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid Expense and Other Assets, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Prepaid expenses and other assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total prepaid expenses and other assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TransferredOverTimeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Transferred over Time [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TransferredOverTimeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Products Transferred Over Time and Fixed Price Contracts [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ClassOfStockDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Class of Stock [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductWarrantyMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Product warranty.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductWarrantyMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Product Warranty [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductWarrantyMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Product Warranty [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Comprehensive Income (Loss), Net of Tax, Attributable to Parent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Comprehensive income</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Shares, Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock, shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Finite-Lived Intangible Assets, Major Class Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Finite-Lived Intangible Assets, Major Class Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FairValueMeasurementPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Fair Value Measurement, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FairValueMeasurementPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Fair Value Measurement</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeExpenseNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Interest Income (Expense), Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeExpenseNet_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Interest (Income), Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeExpenseNet_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Interest (income) expense, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ContingentConsiderationByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Contingent Consideration by Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ContingentConsiderationByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Contingent Consideration by Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Components of Income Tax Expense (Benefit) [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Tax Provision (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockParOrStatedValuePerShare_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Preferred Stock, Par or Stated Value Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockParOrStatedValuePerShare_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Preferred stock, par value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Issued During Period, Shares, Share-based Compensation, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-based compensation, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SalesRevenueNetMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Sales Revenue, Net [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SalesRevenueNetMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Sales Revenue, Net [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesDepreciation_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax liabilities depreciation.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesDepreciation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities Depreciation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesDepreciation_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Depreciation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Amount [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RepaymentsOfLinesOfCredit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Repayments of Lines of Credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RepaymentsOfLinesOfCredit_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Principal payments under line of credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Antidilutive Securities [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Antidilutive Securities [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Process for Informing Management or Committees Responsible [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationOtherAdjustments_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Other Adjustments, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationOtherAdjustments_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DefinedBenefitPlanDisclosureLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Defined Benefit Plan Disclosure [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DefinedBenefitPlanDisclosureLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Defined Benefit Plan Disclosure [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityInteractiveDataCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Interactive Data Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TypeOfAdoptionMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Type of Adoption [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Goodwill [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Vested in Period, Weighted Average Grant Date Fair Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted-Average Grant Price Per Share, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Cash and cash equivalents at end of year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Cash and cash equivalents at beginning of year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_RangeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statistical Measurement [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_RangeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Range [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Valuation allowance for credit losses and disputed amounts.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Valuation Allowance For Credit Losses And Disputed Amounts</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CostOfGoodsAndServicesSold_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cost of Goods and Services Sold</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CostOfGoodsAndServicesSold_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Cost of sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CostOfGoodsAndServicesSold_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Cost of Goods and Services Sold, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CostOfGoodsAndServicesSold_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Cost of Sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseCost_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Cost</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseCost_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating lease cost</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stockholders' Equity, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Treasury Stock</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainContingencyNatureDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain Contingency, Nature [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Line of Credit Facility, Additional Borrowing Capacity.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility Additional Borrowing Capacity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revolving loans in a collective maximum principal amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RelatedPartyDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Related Party [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disaggregation of Revenue [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Disaggregated Net Sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax assets tax cut and jobs act capitalization of research and development costs.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets Tax Cut And Jobs Act Capitalization Of Research And Development Costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Tax Cut and Jobs Act capitalization of research and development costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Maturity [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Maturities of operating lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Basis of Presentation and Significant Accounting Policies [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Significant Accounting Policies</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Grants in Period, Weighted Average Grant Date Fair Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted-Average Grant Price Per Share, Granted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Employee Service Share-based Compensation, Nonvested Awards, Compensation Cost Not yet Recognized, Period for Recognition</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Compensation cost recognition period for unvested awards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_MachineryAndEquipmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Machinery and Equipment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_MachineryAndEquipmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Machinery and Equipment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResearchAndDevelopmentExpensePolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Research and Development Expense, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResearchAndDevelopmentExpensePolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Research and Development Costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Assets_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Assets_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Assets_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Total Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Expected term (years)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TaxPeriodAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Tax Period [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxLiabilities_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTotalLabel">Gross deferred tax liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnusualOrInfrequentItemDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Unusual or Infrequent Item, or Both [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Vested in Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Performance-based Restricted Stock, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel">Time-based Restricted Stock, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">New Accounting Pronouncements, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">New Accounting Standards Recently Adopted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityAddressCityOrTown_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Address, City or Town</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Equity [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of customer accounted for ten percent or more account receivable.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Customer Accounted For Ten Percent Or More Account Receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of customer accounted for 10% or more account receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax assets operating lease liabilities.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets Operating Lease Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Operating lease liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AuditorLocation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Auditor Location</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Materially Affected or Reasonably Likely to Materially Affect Registrant [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Forfeited in Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Performance-based Restricted Stock, Forfeited</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel">Time-based Restricted Stock, Forfeited</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of divesture of interests in subsidiary.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Divesture Of Interests In Subsidiary [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Sale of Trex Commercial Products, Inc.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Compensation and Employee Benefit Plans, Other than Share-based Compensation [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Employee Benefit Plans</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowances and Reserves, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Balance at End of Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Balance at Beginning of Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Compensation Cost for Share-based Payment Arrangements, Allocation of Share-based Compensation Costs by Plan [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Stock-Based Compensation Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Depreciation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Depreciation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Depreciation_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Depreciation expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax liabilities goodwill amortization.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities Goodwill Amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Goodwill amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetIncomeLossAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Income (Loss) Attributable to Parent [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetIncomeLossAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Numerator:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Vested in Period, Fair Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Total fair value of restricted shares vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Segment Reporting Information, by Segment [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Segment Reporting Information, by Segment [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Third Party Oversight and Identification Processes [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disclosure of Compensation Related Costs, Share-based Payments [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-Based Compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Positions or Committees Responsible Report to Board [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConstructionInProgressMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Construction in Progress [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConstructionInProgressMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Construction in Process [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Number of Shares Authorized</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Total aggregate number of shares of common stock that may be issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Issued During Period, Shares, Share-based Compensation, Net of Forfeitures</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Employee stock plans, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Current State and Local Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">State</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Weighted Average Discount Rate, Percent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Weighted average discount rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfLargestRawMaterialSuppliers_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of largest raw material suppliers.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfLargestRawMaterialSuppliers_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Largest Raw Material Suppliers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfLargestRawMaterialSuppliers_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of largest raw material suppliers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Segment Reporting, CODM, Individual Title and Position or Group Name [Extensible Enumeration]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InternetDomainNamesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Internet Domain Names [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InternetDomainNamesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Domain Names [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityPublicFloat_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Public Float</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Net of Valuation Allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsNet_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Gross deferred tax assets, after valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplierConcentrationRiskMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplier Concentration Risk [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplierConcentrationRiskMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Supplier Concentration Risk [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesCurrentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Liabilities, Current [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesCurrentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Current Liabilities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FourLargestSuppliersMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Four largest suppliers.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FourLargestSuppliersMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Four Largest Suppliers [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FourLargestSuppliersMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Four Largest Suppliers [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_GrossAssetAndLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gross asset and liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_GrossAssetAndLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Gross asset and liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsReceivableMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounts Receivable [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsReceivableMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accounts Receivable [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxesPaidNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Taxes Paid, Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxesPaidNet_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Cash paid for income taxes, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentType_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Type</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Adjustments for New Accounting Pronouncements [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Product Warranty Liability [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Trex Residential Product Warranty and Surface Flaking Reserves Activity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_Security12bTitle_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Title of 12(b) Security</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashAndCashEquivalentsAtCarryingValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash and Cash Equivalents, at Carrying Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashAndCashEquivalentsAtCarryingValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Cash and cash equivalents</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill and Intangible Assets, Goodwill, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Goodwill</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due Year Five</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2029</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management, Strategy, and Governance [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementOfStockholdersEquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statement of Stockholders' Equity [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentFiscalPeriodFocus_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Fiscal Period Focus</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResearchAndDevelopmentExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Research and Development Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResearchAndDevelopmentExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Research and Development costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarliestTaxYearMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Earliest Tax Year [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Indefinite-lived Intangible Assets [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Indefinite-lived Intangible Assets [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disaggregation of Revenue [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BuildingAndBuildingImprovementsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Building and Building Improvements [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BuildingAndBuildingImprovementsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Building and Improvements [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentGross_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentGross_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SubsequentEventTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Subsequent Event Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SubsequentEventTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Subsequent Event Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeLeasesPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Leases [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeLeasesPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Leases</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Share-based Payment Award, Stock Options, Valuation Assumptions [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Assumptions Used to Estimate Fair Value of Each SAR</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingSegmentsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Segments [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingSegmentsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Operating Segments [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowances and Reserves Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">SEC Schedule, 12-09, Valuation Allowances and Reserves Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, State and Local Income Taxes, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">State and local taxes, net of U.S. Federal benefit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Credit facility one axis.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Credit Facility One [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Credit Facility One [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Investing Activities [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Investing Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationTaxSettlements_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Tax Settlement, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxReconciliationTaxSettlements_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Excess tax benefits from vesting or settlement of stock compensation awards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Payments for Repurchase of Common Stock</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Repurchases of common stock</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Category of Item Purchased [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Category of Item Purchased [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revenue from Contract with Customer, Excluding Assessed Tax</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Net sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Net Sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard and Extended Product Warranty Accrual, Period Increase (Decrease)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Warranty reserve increase (decrease)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Effective Income Tax Rate Reconciliation [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Reconciliation of Differences between Income Tax Provision and Income Tax Determined by Applying US Federal Statutory Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management, Strategy, and Governance [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Line of Credit Facility [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Selling, General and Administrative Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Selling, general and administrative expenses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Selling, General and Administrative Expense, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Selling, General, and Administrative Expenses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockRepurchasedDuringPeriodValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Repurchased During Period, Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockRepurchasedDuringPeriodValue_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Repurchases of common stock</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CreditFacilityDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Credit Facility [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CreditFacilityDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Credit Facility [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Accrued Liabilities, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Accounts Payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accounts payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Subsidiary or Equity Method Investee [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesAndStockholdersEquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Liabilities and Equity [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesAndStockholdersEquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">LIABILITIES AND STOCKHOLDERS' EQUITY</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentPeriodEndDate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Period End Date</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Financing Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Net cash provided by (used in) financing activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid Expense and Other Assets [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NonRule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Non Rule 10b51 Arr Modified Flag</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NonRule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Non rule 10b51 arr modified flag.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NonRule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Non Rule 10b5-1 Arrangement Modified</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_IcfrAuditorAttestationFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">ICFR Auditor Attestation Flag</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Effective Income Tax Rate Reconciliation, Percent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Effective tax rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityNoteAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stockholders' Equity Note [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Anti-dilutive securities excluded from the computation of diluted earnings per share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SelectDeckingAndUniversalFasciaMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Select decking and universal fascia.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SelectDeckingAndUniversalFasciaMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Select Decking And Universal Fascia [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInThirdYear_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Purchase Obligation, Due in Third Year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PurchaseObligationDueInThirdYear_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Purchase commitment, due in third year</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due after Year Five</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Thereafter</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ResidentialAndCommercialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Residential and commercial use member.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ResidentialAndCommercialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Residential and Commercial Use [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Segment Reporting, CODM, Profit (Loss) Measure, How Used, Description</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income tax expense (benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total income tax provision</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Provision for income taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Expense (Benefit), Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxAuthorityNameAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Authority, Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnSaleOfPropertyPlantEquipment_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain (Loss) on Disposition of Property Plant Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnSaleOfPropertyPlantEquipment_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Loss (gain) on disposal of property, plant and equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComponentsOfDeferredTaxAssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Components of Deferred Tax Assets [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ComponentsOfDeferredTaxAssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred tax assets:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_TradingSymbol_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Trading Symbol</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Railing.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RailingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Railing [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashFlowOperatingActivitiesLesseeAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash Flow, Operating Activities, Lessee [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashFlowOperatingActivitiesLesseeAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Supplemental cash flow information</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VariableRateAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Variable Rate [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VariableRateAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Variable Rate [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stockholders' Equity Attributable to Parent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total Stockholders' Equity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ValuationAndQualifyingAccountsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation and Qualifying Accounts [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument, Description of Variable Rate Basis</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt instrument, description of variable rate basis</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxesReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Taxes Receivable, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxesReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income tax receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsGross_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsGross_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Gross deferred tax assets, before valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment, Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherLiabilitiesNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Liabilities, Noncurrent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherLiabilitiesNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other long-term liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation, Option and Incentive Plans Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-Based Compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_Rule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Rule10b51 Arr Modified Flag</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_Rule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Rule10b51 arr modified flag.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_Rule10B51ArrModifiedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Rule 10b5-1 Arrangement Modified</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_IndustrialRevenueBondsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Industrial Revenue Bonds Member</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_IndustrialRevenueBondsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Industrial Revenue Bonds.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_IndustrialRevenueBondsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Industrial Revenue Bonds (IRBs) [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management, Strategy, and Governance [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EBITDA_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">EBITDA.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EBITDA_lbl" xlink:role="http://www.xbrl.org/2003/role/label">E B I T D A</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EBITDA_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">EBITDA</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Goodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Goodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Goodwill</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtWeightedAverageInterestRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt, Weighted Average Interest Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtWeightedAverageInterestRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt, Weighted Average Interest Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Expertise of Management Responsible [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ShareRepurchaseProgramAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Repurchase Program [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ShareRepurchaseProgramAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Share Repurchase Program [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NatureOfOperations_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Nature of Operations [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NatureOfOperations_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Business and Organization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Non-Option Equity Instruments, Granted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Granted, SARs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Income Tax Expense (Benefit)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Deferred income taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LeasesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Leases [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AreaOfLand_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Area of Land</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SwinglineLetterOfCreditMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Swingline letter of credit member.
.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SwinglineLetterOfCreditMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Swingline Letter Of Credit [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SwinglineLetterOfCreditMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Swingline Letter Of Credit [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UseOfEstimates_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Use of Estimates, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UseOfEstimates_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Use of Estimates</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskPercentage1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk, Percentage</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskPercentage1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentration risk as percentage of total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashAndCashEquivalentsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash and Cash Equivalents, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashAndCashEquivalentsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Cash and Cash Equivalents</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccruedMarketingCostsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accrued Marketing Costs, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccruedMarketingCostsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Sales and marketing</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share Based Compensation Arrangement By Share Based Payment Award Fair Value Assumptions And Methodology [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Fair Value Assumptions And Methodology [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Share Based Compensation Arrangement By Share Based Payment Award Fair Value Assumptions And Methodology [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Components Of Basic And Diluted Earning Per Share [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Components Of Basic And Diluted Earning Per Share [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Components Of Basic And Diluted Earning Per Share [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Agreement domain.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Agreement [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Agreement [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Dividend Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Dividend yield</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Credit facility one domain.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Credit Facility One [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditFacilityOneDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Credit Facility One [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_SecurityExchangeName_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Security Exchange Name</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Tax Credit Carryforwards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">State tax credit carryforwards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment, Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementClassOfStockAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Class of Stock [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_OtherResidentialMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Other residential.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_OtherResidentialMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Residential [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_OtherResidentialMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other Residential [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accumulated Depreciation, Depletion and Amortization, Property, Plant, and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Accumulated depreciation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InvestmentsAllOtherInvestmentsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Investments, All Other Investments [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due Year Three</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2027</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MaximumMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Maximum [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MaximumMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Maximum [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Liabilities and Equity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total Liabilities and Stockholders' Equity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntangibleAssetsGrossExcludingGoodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Intangible Assets, Gross (Excluding Goodwill)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IntangibleAssetsGrossExcludingGoodwill_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Intangible Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Right-of-Use Asset</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Operating lease ROU assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating lease assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid Expense, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidExpenseCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Prepaid expenses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplementalCashFlowInformationAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplemental Cash Flow Information [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplementalCashFlowInformationAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Supplemental disclosures of cash flow information:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CompensationAndRetirementDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Retirement Benefits [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RevolvingBLoanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Revolving b loan.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RevolvingBLoanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revolving B Loan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_RevolvingBLoanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revolving B Loan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareDiluted_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Earnings Per Share, Diluted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareDiluted_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Diluted earnings per common share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_EarningsPerShareDiluted_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Diluted earnings per share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LeaseholdImprovementsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Leasehold Improvements [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Performance based restricted stock and performance based restricted stock units.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Performance Based Restricted Stock And Performance Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Performance-Based Restricted Stock and Performance-Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Liabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_Liabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Assets, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total current assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Operating Assets [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Changes in operating assets and liabilities:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Investing Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Net cash used in investing activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnrecognizedTaxBenefits_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Unrecognized Tax Benefits</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnrecognizedTaxBenefits_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Unrecognized tax benefits related to identified uncertain tax positions</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnrecognizedTaxBenefits_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Unrecognized Tax Benefits, Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnrecognizedTaxBenefits_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Unrecognized Tax Benefits, Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Award Vesting Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Vesting period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Interest Income, Operating</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Interest Income, Operating, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestIncomeOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Interest Revenue</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityFilerCategory_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Filer Category</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill and Intangible Assets Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Goodwill and Other Intangible Assets, Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Financing Receivable Portfolio Segment [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Financing Receivable Portfolio Segment [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Components Of Basic And Diluted Earning Per Share [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Components Of Basic And Diluted Earning Per Share [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Components Of Basic And Diluted Earning Per Share [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CommercialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Commercial use.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CommercialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Commercial Use [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CommercialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Commercial Use [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_InsuranceProceedsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Insurance proceeds.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_InsuranceProceedsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Insurance Proceeds [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_InsuranceProceedsPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Insurance Proceeds</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Non-Option Equity Instruments, Exercised</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Exercised, SARs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyLiabilityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Product Warranty Liability [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyLiabilityLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Product Warranty Liability [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PaymentsForProceedsFromFinancingCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Payments for (proceeds from) financing costs.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PaymentsForProceedsFromFinancingCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Payments For Proceeds From Financing Costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PaymentsForProceedsFromFinancingCosts_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Financing costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GuaranteeObligationsNatureDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Guarantor Obligations, Nature [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GuaranteeObligationsNatureDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Guarantor Obligations, Nature [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_CurrentFiscalYearEndDate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Current Fiscal Year End Date</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Undiscounted Excess Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Less imputed interest</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LandAndLandImprovements_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Land and Land Improvements</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AwardTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Award Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-based compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Related Party [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments canceled weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Canceled Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Canceled, Weighted Average Grant Price Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityRegistrantName_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Registrant Name</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Time Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Time Based Restricted Stock Units Member</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TimeBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Time-Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Indefinite-lived Intangible Assets, Major Class Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Indefinite-lived Intangible Assets, Major Class Name [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GrossProfit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gross Profit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GrossProfit_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Gross profit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NumberOfReportableSegments_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number of Reportable Segments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NumberOfReportableSegments_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of reportable segment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NumberOfReportableSegments_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Number of reportable segments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Share-based Compensation Arrangements by Share-based Payment Award [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Share-based Compensation Arrangements by Share-based Payment Award [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentMaturityDate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument, Maturity Date</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentMaturityDate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Matutiry date of credit agreement</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityEmergingGrowthCompany_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Emerging Growth Company</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccountingPoliciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Accounting Policies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccountingPoliciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounting Policies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccountingPoliciesTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accounting Policies [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsToAcquireIntangibleAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Payments to Acquire Intangible Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsToAcquireIntangibleAssets_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Purchased intangibles</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Weighted Average Number of Shares Outstanding, Basic</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Basic weighted average common shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Basic weighted average shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VestingDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Vesting [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_VestingDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Vesting [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Schedule of Valuation and Qualifying Accounts Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule II - Valuation and Qualifying Accounts and Reserves</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease Liabilities, Payments Due [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_WarrantyPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">The number of years the Company warrants that its products will be free from material defects in workmanship and materials.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_WarrantyPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Warranty Period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_WarrantyPeriod_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Warranty period</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Performance Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Performance Based Restricted Stock Units Member</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Performance-Based Restricted Stock Units [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Shares Authorized</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock, shares authorized</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ShareRepurchaseProgramDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Repurchase Program [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ShareRepurchaseProgramDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Share Repurchase Program [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Shares Paid for Tax Withholding for Share Based Compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Shares withheld for taxes on awards, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment, Useful Life</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, plant, and equipment estimated useful life</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskByTypeAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentration Risk Type [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesDeductions_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowances and Reserves, Deduction</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesDeductions_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Deductions</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities, Inventory</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Aggregate Intrinsic Value, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Aggregate Intrinsic Value, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentsIncorporatedByReferenceTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Documents Incorporated by Reference</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Fair value assumptions method used</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-Based Payment Arrangement, Valuation Technique [Extensible Enumeration]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">New accounting standards not yet adopted policy.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">New Accounting Standards Not Yet Adopted [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">New Accounting Standards Not Yet Adopted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AmortizationOfIntangibleAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Amortization of Intangible Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AmortizationOfIntangibleAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Amortization of intangible asset</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Long-term Purchase Commitment, Category of Item Purchased [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Long-term Purchase Commitment, Category of Item Purchased [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Proceeds from Divestiture of Interest in Subsidiaries and Affiliates</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Proceeds from sale of assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueRecognitionPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revenue Recognition, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueRecognitionPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revenue Recognition</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disclosure of Compensation Related Costs, Share-based Payments [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Issued During Period, Value, Share-based Compensation, Net of Forfeitures</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Employee stock plans</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpenditure_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Capital expenditure.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpenditure_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Capital Expenditure</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CapitalExpenditure_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Capital Expenditures</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillImpairmentLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Annual impairment test of goodwill</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillImpairmentLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Impairment Charge</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillImpairmentLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill impairment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskRoleOfManagementTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Role of Management [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">2023 stock repurchase program member.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Two Thousand Twenty Three Stock Repurchase Program [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">2023 Stock Repurchase Program [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountingPoliciesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounting Policies [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplyCommitmentAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supply Commitment [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCredit_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Long-Term Line of Credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCredit_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Long-Term Line of Credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InsuranceSettlementMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Insurance Settlement [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stockholders' Equity Attributable to Parent [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StockholdersEquityAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stockholders' Equity:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SupplyCommitmentArrangementMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supply Commitment Arrangement [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash Flow, Noncash Investing and Financing Activities Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Supplemental non-cash investing and financing disclosure:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statement [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Statement [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Property, Plant and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Weighted Average Number of Shares Outstanding, Basic [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Denominator:</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Preferred Stock, Shares Authorized</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesAuthorized_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Preferred stock, shares authorized</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityFileNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity File Number</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Segment Reporting Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Segment Information</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents, Period Increase (Decrease), Including Exchange Rate Effect</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Net decrease in cash and cash equivalents</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevenueFromContractWithCustomerAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revenue from Contract with Customer [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TransferredAtPointInTimeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Transferred at Point in Time [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TransferredAtPointInTimeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Products Transferred at a Point in Time and Variable Consideration Contracts [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditAgreementSecondAmendmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Credit Agreement Second Amendment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CreditAgreementSecondAmendmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Credit agreement second amendment.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Tax Deferred Expense, Compensation and Benefits, Share-based Compensation Cost</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Stock-based compensation</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StatementOfFinancialPositionAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Statement of Financial Position [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingIncomeLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Income (Loss)</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingIncomeLoss_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Income from operations</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestExpenseOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Interest Expense, Operating</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestExpenseOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Interest Expense, Operating, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InterestExpenseOperating_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Interest Expense</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Volatility Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Expected volatility</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccruedIncomeTaxesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccruedIncomeTaxesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accrued Income Taxes, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LetterOfCreditMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Letter of Credit [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LetterOfCreditMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Letter of Credit [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of customer accounted for ten percent or more sales of net sales.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Customer Accounted For Ten Percent Or More Sales Of Net Sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of customers that accounted for 10% or more of net sales</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityShellCompany_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Shell Company</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Line of Credit Facility [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityTaxIdentificationNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Tax Identification Number</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Assets [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AssetsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">ASSETS</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfSalesRetailers_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of national sales retailers.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfSalesRetailers_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Number Of Sales Retailers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_NumberOfSalesRetailers_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of national retailers</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FairValueOfFinancialInstrumentsPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Fair Value of Financial Instruments, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FairValueOfFinancialInstrumentsPolicy_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Fair Value of Financial Instruments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityCurrentReportingStatus_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Current Reporting Status</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedManufacturingExpensesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Accrued expenses related to manufacturing facilities primarily consisting of accrued utilities, equipment rentals and temporary labor expenses.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedManufacturingExpensesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accrued Manufacturing Expenses Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedManufacturingExpensesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Manufacturing costs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule of divesture of interests in subsidiary.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Divesture Of Interests In Subsidiary [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WarrantyReservesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Reserve, Warranty [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WarrantyReservesMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Warranty Reserve [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SoftwareDevelopmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Software Development [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SoftwareDevelopmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Internal Use Software [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Property, Plant and Equipment Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Property, Plant and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowance, Deferred Tax Asset [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Valuation Allowance of Deferred Tax Assets [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentFiscalYearFocus_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Fiscal Year Focus</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options exercisable intrinsic value.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Exercisable Intrinsic Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Aggregate Intrinsic Value, Exercisable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Preferred Stock, Value, Issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockValue_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Preferred stock, $0.01 par value, 3,000,000 shares authorized; none issued and outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments exercisable weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Exercisable Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Exercisable, Weighted Average Grant Price Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Non-Option Equity Instruments, Forfeitures</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Canceled, SARs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Finite-Lived Intangible Assets, Accumulated Amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accumulated Amortization</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_CityAreaCode_lbl" xlink:role="http://www.xbrl.org/2003/role/label">City Area Code</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Liabilities, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LiabilitiesCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total current liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SeasonalityDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Identifies seasonal trends affecting the demand for Trex products and quarterly net sales.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SeasonalityDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Seasonality Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SeasonalityDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Seasonality</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LineOfCreditFacilityLenderDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit Facility, Lender [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LIFOInventoryAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/label">LIFO Inventory Amount</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LIFOInventoryAmount_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total LIFO inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryNet_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, Net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryNet_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyLiabilityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Product Warranty Liability [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProductWarrantyLiabilityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Product Warranty Liability [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryFinishedGoods_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, Finished Goods, Gross</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryFinishedGoods_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Finished goods</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Stock Repurchase Program, Number of Shares Authorized to be Repurchased</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock repurchase program, authorized shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Organization, Consolidation and Presentation of Financial Statements [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_LocalPhoneNumber_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Local Phone Number</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Preferred Stock, Shares Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PreferredStockSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Preferred stock, shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResidentialPortfolioSegmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Residential Portfolio Segment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ResidentialPortfolioSegmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Residential [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of equity instruments other than options vested.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share Based Payment Award, Non-Option Equity Instruments, Vested</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Vested, SARs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Income Tax, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncomeTaxPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income Taxes</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Commitments and Contingencies Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Shares, Issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Ending Balance, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharesIssued_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Beginning Balance, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Treasury Stock, Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockValue_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Treasury stock, at cost, 33,943,946 and 32,363,306 shares at December 31, 2024 and December 31, 2023, respectively</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerOneMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Customer one.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerOneMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer One [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerOneMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer One [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Deferred Tax Assets and Liabilities [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Deferred Tax Assets and Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty Accrual, Noncurrent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Non-current accrued warranty</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_GainLossOnInsuranceSettlement_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Gain loss on insurance settlement.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_GainLossOnInsuranceSettlement_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain Loss On Insurance Settlement</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_GainLossOnInsuranceSettlement_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Gain loss on insurance settlement</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Liability, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Operating lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PublicUtilitiesInventoryRawMaterialsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Raw Materials [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Products sold prior to&#160;january&#160;one, two thousand and twenty three {Member].</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Products Sold Prior to January One, Two Thousand and Twenty Three [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentInterestRateStatedPercentage_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument, Interest Rate, Stated Percentage</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentInterestRateStatedPercentage_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt instrument, Interest rate, Stated percentage</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RetainedEarningsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Retained Earnings [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RetainedEarningsMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Retained Earnings [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Payments to Acquire Property, Plant, and Equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Expenditures for property, plant and equipment</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_DocumentTransitionReport_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Document Transition Report</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Purchase Price of Common Stock, Percent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Percentage of market price on lesser of either first day of calendar quarter or last day of calendar quarter for purchase price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due Year Two</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2026</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">SEC Schedule, 12-09, Valuation Allowances and Reserves [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">SEC Schedule, 12-09, Valuation Allowances and Reserves [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PostemploymentBenefitsAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Postemployment Benefits [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedCapitalProjectsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accrued Capital Projects Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedCapitalProjectsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Accrued capital projects current.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedCapitalProjectsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Capital Projects</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskCreditRisk_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk, Credit Risk, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskCreditRisk_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentrations and Credit Risk</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_AuditorFirmId_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Auditor Firm ID</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MinimumMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Minimum [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_MinimumMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Minimum [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Percentage change in the expected number of remaining claims to be settled with payment or the expected cost to settle claims used as a threshold for disclosure.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Percent Sensitivity Change In Expected Surface Flaking Claims</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Percentage change in warranty claims used as a threshold for disclosure</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common Stock [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EmployeeStockPurchasePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Employee stock purchase plan.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EmployeeStockPurchasePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Employee Stock Purchase Plan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_EmployeeStockPurchasePlanMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Employee Stock Purchase Plan [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">The weighted average grant-date fair value of equity instruments other than options granted during the reporting period as calculated by applying the disclosed option pricing methodology.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Equity Instruments Other Than Option Grants In Period Weighted Average Grant Date Fair Value Per Pricing Model</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Weighted-average fair value of grants</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Investment, Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Investment, Name [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Weighted Average Grant Date Fair Value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel">Nonvested, Weighted-Average Grant Price Per Share, Ending Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_lbl" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel">Nonvested, Weighted-Average Grant Price Per Share, Beginning Balance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdditionalPaidInCapitalMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Additional Paid-in Capital [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AdditionalPaidInCapitalMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Additional Paid-In Capital [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityWellKnownSeasonedIssuer_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Well-known Seasoned Issuer</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule Of Stock Appreciation Rights Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Stock Appreciation Rights Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Stock Appreciation Rights Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax liabilities inventories and other.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities Inventories and Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ReportingUnitAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Reporting Unit [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments vested weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Vested Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Vested, Weighted Average Grant Price Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due Next Twelve Months</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">2025</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAssetsNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Assets, Noncurrent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAssetsNoncurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Description of operating leases with initial term.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Description of Operating Leases With Initial Term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating leases with an initial term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidAdvertising_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid Advertising</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_PrepaidAdvertising_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Prepaid expenses for production costs of advertising</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfInventoryCurrentTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Inventory, Current [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfInventoryCurrentTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SignatureRailingAndTranscendCladdingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Signature railing and transcend cladding.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SignatureRailingAndTranscendCladdingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Signature Railing And Transcend Cladding [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Other Assets, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OtherAssetsCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Other</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Goodwill and Intangible Assets Disclosure [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntityCommonStockSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Common Stock, Shares Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancialInstrumentsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Financial Instruments Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_FinancialInstrumentsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Financial Instruments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Accrued Liabilities and Other Operating Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accrued expenses and other liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain (Loss) on Disposition of Stock in Subsidiary</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Gain (loss) on disposition of stock in subsidiary</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Loss on sale</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel">Gain (loss) on disposition of stock in subsidiary</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Disaggregation of Revenue [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DisaggregationOfRevenueLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Disaggregation of Revenue [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BasisOfAccountingPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Basis of Accounting, Policy [Policy Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BasisOfAccountingPolicyPolicyTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Basis of Accounting</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplier [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Income Taxes Payable, Net of Income Taxes Receivable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Income taxes receivable/payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockValue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Common Stock, Value, Issued</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommonStockValue_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Common stock, $0.01 par value, 360,000,000 shares authorized; 141,098,251 and 140,974,843 shares issued and 107,154,305 and 108,611,537 shares outstanding at December 31, 2024 and December 31, 2023, respectively</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LinesOfCreditCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Line of Credit, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LinesOfCreditCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Line of credit</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LinesOfCreditCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Outstanding borrowing capacity</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnDispositionOfAssets1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain (Loss) on Disposition of Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnDispositionOfAssets1_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Gain (Loss) on Disposition of Assets, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnDispositionOfAssets1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Gain (loss) on sale of assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainLossOnDispositionOfAssets1_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Gain (loss) on sale of assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Customer three.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Customer Three [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_CustomerThreeMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Customer Three [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ContingentConsiderationTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Contingent Consideration Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ContingentConsiderationTypeDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Contingent Consideration Type [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Schedule Of Restricted Stock Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule Of Restricted Stock Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfRestrictedStockActivityTable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Schedule Of Restricted Stock Activity [Table]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Total operating liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total operating lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Operating Loss Carryforwards</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Net Operating Losses</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommitmentsAndContingencies_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Commitments and Contingencies</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommitmentsAndContingencies_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Commitments and contingencies</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Standard Product Warranty Accrual, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_StandardProductWarrantyAccrualCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accrued warranty</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Share based compensation arrangement by share based payment award non options equity instruments granted weighted average grant price.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Options Equity Instruments Granted Weighted Average Grant Price</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Granted, Weighted Average Grant Price Per Share</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Weighted Average Number of Shares Outstanding, Diluted</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Diluted weighted average common shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Diluted weighted average shares outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Segment Reporting Information, by Segment [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Details of Segment Information</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsReceivableNetCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounts Receivable, Net, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsReceivableNetCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accounts receivable, net</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Lessee, Operating Lease, Liability, Payments, Due</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total lease payments</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommercialPortfolioSegmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Commercial Portfolio Segment [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CommercialPortfolioSegmentMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Commercial [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInInventories_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Increase (Decrease) in Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncreaseDecreaseInInventories_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Inventories</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Third Party Engaged [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ReportingUnitDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Reporting Unit [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FireAtVirginiaFacilityMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Fire at virginia facility.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_FireAtVirginiaFacilityMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Fire At Virginia Facility [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Concentration Risk Benchmark [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Concentration Risk Benchmark [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Accrued liabilities and other liabilities current excluding warranty.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accrued Liabilities And Other Liabilities Current Excluding Warranty</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accrued expenses and other liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Total accrued expenses and other liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_MaturityPeriodOfCashEquivalent_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Maximum term of original maturities to classify as cash equivalent.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_MaturityPeriodOfCashEquivalent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Maturity Period Of Cash Equivalent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_MaturityPeriodOfCashEquivalent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Maximum term of original maturities to classify as cash equivalent</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="dei_EntitySmallBusiness_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Entity Small Business</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Tabular disclosure of the components of accrued liabilities and other current liabilities.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Schedule of Accrued Liabilities and Other Current Liabilities [Table Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Summary of Accrued Expenses and Other Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingInformationLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Segment Reporting Information [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SegmentReportingInformationLineItems_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Segment Reporting Information [Line Items]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Processes for Assessing, Identifying, and Managing Threats [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Instrument, Basis Spread on Variable Rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Interest rate</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Debt Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DebtDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Debt</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Deferred tax liabilities operating lease right of use assets.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Liabilities Operating Lease Right Of Use Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Operating lease right-of-use asset</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockSharesAcquired_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Treasury Stock, Shares, Acquired</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockSharesAcquired_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Number of shares repurchased by the Company</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_TreasuryStockSharesAcquired_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Repurchases of common stock, Shares</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplier [Domain]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Proceeds from Issuance of Shares under Incentive and Share-based Compensation Plans, Including Stock Options</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Proceeds from employee stock purchase and option plans</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CreditFacilityAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Credit Facility [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_CreditFacilityAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Credit Facility [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevolvingCreditFacilityMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Revolving Credit Facility [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RevolvingCreditFacilityMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Revolving Credit Facility [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryLIFOReserve_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Inventory, LIFO Reserve</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryLIFOReserve_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Excess of the replacement cost of inventory over the LIFO value of inventory</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryLIFOReserve_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel">Reserve to adjust inventories to LIFO value</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InventoryLIFOReserve_lbl" xlink:role="http://www.xbrl.org/2003/role/totalLabel">Inventory, LIFO Reserve, Total</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Number of equity instruments other than options exercisable.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share Based Compensation Arrangement By Share Based Payment Award Non Option Equity Instruments Exercisable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Exercisable, SARs</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SupplementalBalanceSheetInformationAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Supplemental balance sheet information [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SupplementalBalanceSheetInformationAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Supplemental balance sheet information</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Net Cash Provided by (Used in) Financing Activities [Abstract]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Financing Activities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InternalRevenueServiceIRSMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Internal Revenue Service (IRS) [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_InternalRevenueServiceIRSMember_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Federal Tax Jurisdiction [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounts Payable, Accrued Liabilities, and Other Liabilities Disclosure, Current [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accrued Expenses and Other Liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_UnusualOrInfrequentItemAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Unusual or Infrequent Item, or Both [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Incremental Common Shares Attributable to Dilutive Effect of Share-based Payment Arrangements</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Dilutive securities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Agreement.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Agreement [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_AgreementAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Agreement [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Right-of-Use Asset Obtained in Exchange for Operating Lease Liability</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Operating ROU assets obtained in exchange for lease liabilities</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_GainContingenciesByNatureAxis_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Gain Contingencies, Nature [Axis]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ResidentialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Residential use.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ResidentialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Residential Use [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_ResidentialUseMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Residential Use [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Deferred Tax Assets, Valuation Allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance_lbl" xlink:role="http://www.xbrl.org/2009/role/negatedLabel">Valuation allowance</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Aggregate Intrinsic Value, Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Aggregate Intrinsic Value, Outstanding</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Surface flaking.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Surface Flaking [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_SurfaceFlakingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Surface Flaking [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Operating Lease, Weighted Average Remaining Lease Term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1_lbl" xlink:role="http://www.xbrl.org/2003/role/verboseLabel">Weighted average remaining lease term</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Cybersecurity Risk Management Positions or Committees Responsible [Flag]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsPayableCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Accounts Payable, Current</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_AccountsPayableCurrent_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Accounts payable</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">The entire disclosure pertaining to prepaid and other current assets.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Prepaid And Other Current Assets Disclosure [Text Block]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Prepaid Expenses and Other Assets</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BuildingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Building [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="us-gaap_BuildingMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Buildings [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">Domain Names and Internal Use Software [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">Domain names and internal use software.</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember_lbl" xlink:role="http://www.xbrl.org/2003/role/terseLabel">Domain Names and Internal Use Software [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PresidentAndChiefExecutiveOfficerMember_lbl" xlink:role="http://www.xbrl.org/2003/role/label">President and Chief Executive Officer [Member]</link:label>
          <link:label xml:lang="en-US" xlink:type="resource" xlink:label="trex_PresidentAndChiefExecutiveOfficerMember_lbl" xlink:role="http://www.xbrl.org/2003/role/documentation">President and chief executive officer.</link:label>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_StockRepurchaseProgramMember" xlink:to="trex_StockRepurchaseProgramMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LandMember" xlink:to="us-gaap_LandMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:to="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentAxis" xlink:to="us-gaap_DebtInstrumentAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CustomerTwoMember" xlink:to="trex_CustomerTwoMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:to="us-gaap_IncreaseDecreaseInAccountsReceivable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PlanNameDomain" xlink:to="us-gaap_PlanNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CapitalExpendituresInAccountsPayable" xlink:to="trex_CapitalExpendituresInAccountsPayable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" xlink:to="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:to="srt_ValuationAndQualifyingAccountsDisclosureTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsDeferredIncome" xlink:to="us-gaap_DeferredTaxAssetsDeferredIncome_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:to="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityAddressPostalZipCode" xlink:to="dei_EntityAddressPostalZipCode_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:to="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:to="us-gaap_AssetsAndLiabilitiesLesseeAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationNondeductibleExpense" xlink:to="us-gaap_IncomeTaxReconciliationNondeductibleExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityIncorporationStateCountryCode" xlink:to="dei_EntityIncorporationStateCountryCode_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InterestPaidNet" xlink:to="us-gaap_InterestPaidNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxAuthorityNameDomain" xlink:to="us-gaap_IncomeTaxAuthorityNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OtherNoncashIncomeExpense" xlink:to="us-gaap_OtherNoncashIncomeExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsInventory" xlink:to="us-gaap_DeferredTaxAssetsInventory_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" xlink:to="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:to="us-gaap_IntangibleAssetsNetIncludingGoodwill_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_AuditorName" xlink:to="dei_AuditorName_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredFederalIncomeTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OpenTaxYear" xlink:to="us-gaap_OpenTaxYear_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeasesTextBlock" xlink:to="us-gaap_LesseeOperatingLeasesTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:to="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LatestTaxYearMember" xlink:to="us-gaap_LatestTaxYearMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TwoThousandFourteenStockIncentivePlanMember" xlink:to="trex_TwoThousandFourteenStockIncentivePlanMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductOrServiceAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:to="us-gaap_DeferredIncomeTaxLiabilitiesNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityAxis" xlink:to="us-gaap_LineOfCreditFacilityAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_EquityMethodInvesteeNameDomain" xlink:to="srt_EquityMethodInvesteeNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationTaxCredits" xlink:to="us-gaap_IncomeTaxReconciliationTaxCredits_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DepreciationDepletionAndAmortization" xlink:to="us-gaap_DepreciationDepletionAndAmortization_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_BaseRateMember" xlink:to="us-gaap_BaseRateMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" xlink:to="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockRepurchasedDuringPeriodShares" xlink:to="us-gaap_StockRepurchasedDuringPeriodShares_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_ScheduleOfGoodwillTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="us-gaap_ClassOfTreasuryStockTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:to="us-gaap_ConcentrationRiskByBenchmarkAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:to="us-gaap_StockholdersEquityNoteDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:to="us-gaap_RevenueFromContractWithCustomerTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" xlink:to="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentCarryingAmount" xlink:to="us-gaap_DebtInstrumentCarryingAmount_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" xlink:to="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IntersegmentEliminationMember" xlink:to="us-gaap_IntersegmentEliminationMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:to="us-gaap_FiniteLivedIntangibleAssetUsefulLife_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryPolicyTextBlock" xlink:to="us-gaap_InventoryPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityCentralIndexKey" xlink:to="dei_EntityCentralIndexKey_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_AuditorOpinionTextBlock" xlink:to="dei_AuditorOpinionTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ForkliftsAndTractorsMember" xlink:to="trex_ForkliftsAndTractorsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdvertisingExpense" xlink:to="us-gaap_AdvertisingExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" xlink:to="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockSharesIssued" xlink:to="us-gaap_CommonStockSharesIssued_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_StagingMember" xlink:to="trex_StagingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:to="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TrexCommercialProductsIncMember" xlink:to="trex_TrexCommercialProductsIncMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_IncomeStatementAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" xlink:to="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityAddressStateOrProvince" xlink:to="dei_EntityAddressStateOrProvince_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SurfaceFlakingWarrantyReserveMember" xlink:to="trex_SurfaceFlakingWarrantyReserveMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskTypeDomain" xlink:to="us-gaap_ConcentrationRiskTypeDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_EquityClassOfTreasuryStockLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_StockAppreciationRightsMember" xlink:to="trex_StockAppreciationRightsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_MajorCustomersAxis" xlink:to="srt_MajorCustomersAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" xlink:to="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CustomerConcentrationRiskMember" xlink:to="us-gaap_CustomerConcentrationRiskMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityExpirationDate1" xlink:to="us-gaap_LineOfCreditFacilityExpirationDate1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" xlink:to="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" xlink:to="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="trex_ScheduleOfCommitmentsAndContingenciesTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryRawMaterials" xlink:to="us-gaap_InventoryRawMaterials_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TreasuryStockCommonShares" xlink:to="us-gaap_TreasuryStockCommonShares_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_CoverAbstract" xlink:to="dei_CoverAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EarningsPerShareBasic" xlink:to="us-gaap_EarningsPerShareBasic_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_IncomeTaxContingencyLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_RevolvingALoansMember" xlink:to="trex_RevolvingALoansMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_IncomeTaxContingencyTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyAccrualPayments" xlink:to="us-gaap_StandardProductWarrantyAccrualPayments_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentAnnualReport" xlink:to="dei_DocumentAnnualReport_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ConsolidationItemsDomain" xlink:to="srt_ConsolidationItemsDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AllocatedShareBasedCompensationExpense" xlink:to="us-gaap_AllocatedShareBasedCompensationExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdvertisingCostsPolicyTextBlock" xlink:to="us-gaap_AdvertisingCostsPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PurchaseObligationDueInFourthYear" xlink:to="us-gaap_PurchaseObligationDueInFourthYear_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:to="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RetainedEarningsAccumulatedDeficit" xlink:to="us-gaap_RetainedEarningsAccumulatedDeficit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="us-gaap_SegmentReportingAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SignatureRailingMember" xlink:to="trex_SignatureRailingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyPolicy" xlink:to="us-gaap_StandardProductWarrantyPolicy_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_AssetsCurrentAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" xlink:to="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ScheduleOfStockAppreciationRightsActivityLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_RawMaterialSupplyContractsMember" xlink:to="trex_RawMaterialSupplyContractsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ProductsAndServicesDomain" xlink:to="srt_ProductsAndServicesDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryGross" xlink:to="us-gaap_InventoryGross_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TaxPeriodDomain" xlink:to="us-gaap_TaxPeriodDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentNet" xlink:to="us-gaap_PropertyPlantAndEquipmentNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsByNatureAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_VestingAxis" xlink:to="us-gaap_VestingAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockParOrStatedValuePerShare" xlink:to="us-gaap_CommonStockParOrStatedValuePerShare_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_FifthAmendmentAndRestatedAgreementMember" xlink:to="trex_FifthAmendmentAndRestatedAgreementMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PurchaseObligationDueInSecondYear" xlink:to="us-gaap_PurchaseObligationDueInSecondYear_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_StatementOfCashFlowsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="us-gaap_AntidilutiveSecuritiesNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_StockIssuedSharesEmployeeStockPurchasePlan" xlink:to="trex_StockIssuedSharesEmployeeStockPurchasePlan_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsOther" xlink:to="us-gaap_DeferredTaxAssetsOther_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RestrictedStockMember" xlink:to="us-gaap_RestrictedStockMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_StatementEquityComponentsAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityAddressAddressLine1" xlink:to="dei_EntityAddressAddressLine1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:to="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock" xlink:to="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EmployeeRelatedLiabilitiesCurrent" xlink:to="us-gaap_EmployeeRelatedLiabilitiesCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="trex_ScheduleOfRestrictedStockActivityLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ComputerEquipmentMember" xlink:to="us-gaap_ComputerEquipmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:to="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock" xlink:to="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:to="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyAccrual" xlink:to="us-gaap_StandardProductWarrantyAccrual_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityVoluntaryFilers" xlink:to="dei_EntityVoluntaryFilers_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfFinancialInstitutionWithDeposit" xlink:to="trex_NumberOfFinancialInstitutionWithDeposit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_AmendmentFlag" xlink:to="dei_AmendmentFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TwoThousandEighteenStockRepurchaseProgramMember" xlink:to="trex_TwoThousandEighteenStockRepurchaseProgramMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CurrentFederalTaxExpenseBenefit" xlink:to="us-gaap_CurrentFederalTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TranscendDeckingMember" xlink:to="trex_TranscendDeckingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TextBlockAbstract" xlink:to="us-gaap_TextBlockAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LessorOperatingLeaseTermOfContract" xlink:to="us-gaap_LessorOperatingLeaseTermOfContract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentNameDomain" xlink:to="us-gaap_DebtInstrumentNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdditionalPaidInCapitalCommonStock" xlink:to="us-gaap_AdditionalPaidInCapitalCommonStock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList" xlink:to="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" xlink:to="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetIncomeLoss" xlink:to="us-gaap_NetIncomeLoss_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_VariableRateDomain" xlink:to="us-gaap_VariableRateDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DefinedContributionPlanCostRecognized" xlink:to="us-gaap_DefinedContributionPlanCostRecognized_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="srt_NameOfMajorCustomerDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" xlink:to="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_EquityComponentDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_RangeMember" xlink:to="srt_RangeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentFinStmtErrorCorrectionFlag" xlink:to="dei_DocumentFinStmtErrorCorrectionFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" xlink:to="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" xlink:to="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FurnitureAndFixturesMember" xlink:to="us-gaap_FurnitureAndFixturesMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TreasuryStockCommonMember" xlink:to="us-gaap_TreasuryStockCommonMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_DisaggregationOfRevenueTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_ScheduleOfCommitmentsAndContingenciesLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" xlink:to="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" xlink:to="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementProcessesIntegratedFlag" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProceedsFromLinesOfCredit" xlink:to="us-gaap_ProceedsFromLinesOfCredit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProfitLoss" xlink:to="us-gaap_ProfitLoss_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PreferredStockSharesIssued" xlink:to="us-gaap_PreferredStockSharesIssued_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeasePayments" xlink:to="us-gaap_OperatingLeasePayments_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_ScheduleOfSignificantAccountingPoliciesLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_PayablesAndAccrualsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TransferredOverTimeMember" xlink:to="us-gaap_TransferredOverTimeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ClassOfStockDomain" xlink:to="us-gaap_ClassOfStockDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ProductWarrantyMember" xlink:to="trex_ProductWarrantyMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ComprehensiveIncomeNetOfTax" xlink:to="us-gaap_ComprehensiveIncomeNetOfTax_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockSharesOutstanding" xlink:to="us-gaap_CommonStockSharesOutstanding_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FairValueMeasurementPolicyPolicyTextBlock" xlink:to="us-gaap_FairValueMeasurementPolicyPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InterestIncomeExpenseNet" xlink:to="us-gaap_InterestIncomeExpenseNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationByTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:to="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PreferredStockParOrStatedValuePerShare" xlink:to="us-gaap_PreferredStockParOrStatedValuePerShare_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SalesRevenueNetMember" xlink:to="us-gaap_SalesRevenueNetMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxLiabilitiesDepreciation" xlink:to="trex_DeferredTaxLiabilitiesDepreciation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RepaymentsOfLinesOfCredit" xlink:to="us-gaap_RepaymentsOfLinesOfCredit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationOtherAdjustments" xlink:to="us-gaap_IncomeTaxReconciliationOtherAdjustments_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:to="us-gaap_DefinedBenefitPlanDisclosureLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityInteractiveDataCurrent" xlink:to="dei_EntityInteractiveDataCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TypeOfAdoptionMember" xlink:to="us-gaap_TypeOfAdoptionMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_GoodwillLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:to="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_RangeAxis" xlink:to="srt_RangeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" xlink:to="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CostOfGoodsAndServicesSold" xlink:to="us-gaap_CostOfGoodsAndServicesSold_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseCost" xlink:to="us-gaap_OperatingLeaseCost_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockholdersEquityPolicyTextBlock" xlink:to="us-gaap_StockholdersEquityPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GainContingencyNatureDomain" xlink:to="us-gaap_GainContingencyNatureDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_LineOfCreditFacilityAdditionalBorrowingCapacity" xlink:to="trex_LineOfCreditFacilityAdditionalBorrowingCapacity_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RelatedPartyDomain" xlink:to="us-gaap_RelatedPartyDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:to="us-gaap_DisaggregationOfRevenueTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" xlink:to="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock" xlink:to="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_MachineryAndEquipmentMember" xlink:to="us-gaap_MachineryAndEquipmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ResearchAndDevelopmentExpensePolicy" xlink:to="us-gaap_ResearchAndDevelopmentExpensePolicy_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_Assets" xlink:to="us-gaap_Assets_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TaxPeriodAxis" xlink:to="us-gaap_TaxPeriodAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredIncomeTaxLiabilities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_UnusualOrInfrequentItemDomain" xlink:to="us-gaap_UnusualOrInfrequentItemDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:to="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityAddressCityOrTown" xlink:to="dei_EntityAddressCityOrTown_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_EquityAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxAssetsOperatingLeaseLiabilities" xlink:to="trex_DeferredTaxAssetsOperatingLeaseLiabilities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_AuditorLocation" xlink:to="dei_AuditorLocation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" xlink:to="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock" xlink:to="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowancesAndReservesBalance" xlink:to="us-gaap_ValuationAllowancesAndReservesBalance_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" xlink:to="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_Depreciation" xlink:to="us-gaap_Depreciation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxLiabilitiesGoodwillAmortization" xlink:to="trex_DeferredTaxLiabilitiesGoodwillAmortization_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetIncomeLossAbstract" xlink:to="us-gaap_NetIncomeLossAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" xlink:to="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:to="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConstructionInProgressMember" xlink:to="us-gaap_ConstructionInProgressMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:to="us-gaap_CurrentStateAndLocalTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="srt_ValuationAndQualifyingAccountsDisclosureLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:to="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfLargestRawMaterialSuppliers" xlink:to="trex_NumberOfLargestRawMaterialSuppliers_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" xlink:to="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InternetDomainNamesMember" xlink:to="us-gaap_InternetDomainNamesMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityPublicFloat" xlink:to="dei_EntityPublicFloat_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsNet" xlink:to="us-gaap_DeferredTaxAssetsNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SupplierConcentrationRiskMember" xlink:to="us-gaap_SupplierConcentrationRiskMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="us-gaap_LiabilitiesCurrentAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_FourLargestSuppliersMember" xlink:to="trex_FourLargestSuppliersMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_GrossAssetAndLiability" xlink:to="trex_GrossAssetAndLiability_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccountsReceivableMember" xlink:to="us-gaap_AccountsReceivableMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxesPaidNet" xlink:to="us-gaap_IncomeTaxesPaidNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentType" xlink:to="dei_DocumentType_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:to="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:to="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_Security12bTitle" xlink:to="dei_Security12bTitle_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:to="us-gaap_CashAndCashEquivalentsAtCarryingValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:to="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementOfStockholdersEquityAbstract" xlink:to="us-gaap_StatementOfStockholdersEquityAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentFiscalPeriodFocus" xlink:to="dei_DocumentFiscalPeriodFocus_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ResearchAndDevelopmentExpense" xlink:to="us-gaap_ResearchAndDevelopmentExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EarliestTaxYearMember" xlink:to="us-gaap_EarliestTaxYearMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisaggregationOfRevenueAbstract" xlink:to="us-gaap_DisaggregationOfRevenueAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_BuildingAndBuildingImprovementsMember" xlink:to="us-gaap_BuildingAndBuildingImprovementsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentGross" xlink:to="us-gaap_PropertyPlantAndEquipmentGross_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SubsequentEventTypeDomain" xlink:to="us-gaap_SubsequentEventTypeDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeLeasesPolicyTextBlock" xlink:to="us-gaap_LesseeLeasesPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:to="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingSegmentsMember" xlink:to="us-gaap_OperatingSegmentsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" xlink:to="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CreditFacilityOneAxis" xlink:to="trex_CreditFacilityOneAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxReconciliationTaxSettlements" xlink:to="us-gaap_IncomeTaxReconciliationTaxSettlements_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:to="us-gaap_PaymentsForRepurchaseOfCommonStock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:to="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" xlink:to="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxDisclosureTextBlock" xlink:to="us-gaap_IncomeTaxDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:to="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SellingGeneralAndAdministrativeExpense" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockRepurchasedDuringPeriodValue" xlink:to="us-gaap_StockRepurchasedDuringPeriodValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="us-gaap_CreditFacilityDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OtherAccruedLiabilitiesCurrent" xlink:to="us-gaap_OtherAccruedLiabilitiesCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInAccountsPayable" xlink:to="us-gaap_IncreaseDecreaseInAccountsPayable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_LiabilitiesAndStockholdersEquityAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentPeriodEndDate" xlink:to="dei_DocumentPeriodEndDate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NonRule10B51ArrModifiedFlag" xlink:to="trex_NonRule10B51ArrModifiedFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_IcfrAuditorAttestationFlag" xlink:to="dei_IcfrAuditorAttestationFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:to="us-gaap_EffectiveIncomeTaxRateContinuingOperations_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockholdersEquityNoteAbstract" xlink:to="us-gaap_StockholdersEquityNoteAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SelectDeckingAndUniversalFasciaMember" xlink:to="trex_SelectDeckingAndUniversalFasciaMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PurchaseObligationDueInThirdYear" xlink:to="us-gaap_PurchaseObligationDueInThirdYear_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ResidentialAndCommercialUseMember" xlink:to="trex_ResidentialAndCommercialUseMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" xlink:to="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxAuthorityNameAxis" xlink:to="us-gaap_IncomeTaxAuthorityNameAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:to="us-gaap_GainLossOnSaleOfPropertyPlantEquipment_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_ComponentsOfDeferredTaxAssetsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_TradingSymbol" xlink:to="dei_TradingSymbol_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_RailingMember" xlink:to="trex_RailingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:to="us-gaap_CashFlowOperatingActivitiesLesseeAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_VariableRateAxis" xlink:to="us-gaap_VariableRateAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_StockholdersEquity_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ValuationAndQualifyingAccountsAbstract" xlink:to="srt_ValuationAndQualifyingAccountsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" xlink:to="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxesReceivable" xlink:to="us-gaap_IncomeTaxesReceivable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsGross_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OtherLiabilitiesNoncurrent" xlink:to="us-gaap_OtherLiabilitiesNoncurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:to="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_Rule10B51ArrModifiedFlag" xlink:to="trex_Rule10B51ArrModifiedFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_IndustrialRevenueBondsMember" xlink:to="trex_IndustrialRevenueBondsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_EBITDA" xlink:to="trex_EBITDA_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_Goodwill" xlink:to="us-gaap_Goodwill_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtWeightedAverageInterestRate" xlink:to="us-gaap_DebtWeightedAverageInterestRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" xlink:to="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ShareRepurchaseProgramAxis" xlink:to="srt_ShareRepurchaseProgramAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NatureOfOperations" xlink:to="us-gaap_NatureOfOperations_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_LeasesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AreaOfLand" xlink:to="us-gaap_AreaOfLand_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SwinglineLetterOfCreditMember" xlink:to="trex_SwinglineLetterOfCreditMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_UseOfEstimates" xlink:to="us-gaap_UseOfEstimates_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskPercentage1" xlink:to="us-gaap_ConcentrationRiskPercentage1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:to="us-gaap_CashAndCashEquivalentsPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccruedMarketingCostsCurrent" xlink:to="us-gaap_AccruedMarketingCostsCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:to="trex_ComponentsOfBasicAndDilutedEarningPerShareTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AgreementDomain" xlink:to="trex_AgreementDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CreditFacilityOneDomain" xlink:to="trex_CreditFacilityOneDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_SecurityExchangeName" xlink:to="dei_SecurityExchangeName_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" xlink:to="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_StatementClassOfStockAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_OtherResidentialMember" xlink:to="trex_OtherResidentialMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:to="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InvestmentsAllOtherInvestmentsAbstract" xlink:to="us-gaap_InvestmentsAllOtherInvestmentsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_MaximumMember" xlink:to="srt_MaximumMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_LiabilitiesAndStockholdersEquity_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IntangibleAssetsGrossExcludingGoodwill" xlink:to="us-gaap_IntangibleAssetsGrossExcludingGoodwill_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseRightOfUseAsset" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PrepaidExpenseCurrent" xlink:to="us-gaap_PrepaidExpenseCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SupplementalCashFlowInformationAbstract" xlink:to="us-gaap_SupplementalCashFlowInformationAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:to="us-gaap_CompensationAndRetirementDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_RevolvingBLoanMember" xlink:to="trex_RevolvingBLoanMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_EarningsPerShareDiluted" xlink:to="us-gaap_EarningsPerShareDiluted_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LeaseholdImprovementsMember" xlink:to="us-gaap_LeaseholdImprovementsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" xlink:to="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_Liabilities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_AssetsCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_UnrecognizedTaxBenefits" xlink:to="us-gaap_UnrecognizedTaxBenefits_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InterestIncomeOperating" xlink:to="us-gaap_InterestIncomeOperating_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityFilerCategory" xlink:to="dei_EntityFilerCategory_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock" xlink:to="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="us-gaap_PropertyPlantAndEquipmentAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CommercialUseMember" xlink:to="trex_CommercialUseMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_InsuranceProceedsPolicyTextBlock" xlink:to="trex_InsuranceProceedsPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_ProductWarrantyLiabilityLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PaymentsForProceedsFromFinancingCosts" xlink:to="trex_PaymentsForProceedsFromFinancingCosts_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="us-gaap_GuaranteeObligationsNatureDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_CurrentFiscalYearEndDate" xlink:to="dei_CurrentFiscalYearEndDate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:to="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LandAndLandImprovements" xlink:to="us-gaap_LandAndLandImprovements_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_AwardTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensation" xlink:to="us-gaap_ShareBasedCompensation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityRegistrantName" xlink:to="dei_EntityRegistrantName_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TimeBasedRestrictedStockUnitsMember" xlink:to="trex_TimeBasedRestrictedStockUnitsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GrossProfit" xlink:to="us-gaap_GrossProfit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NumberOfReportableSegments" xlink:to="us-gaap_NumberOfReportableSegments_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentMaturityDate" xlink:to="us-gaap_DebtInstrumentMaturityDate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityEmergingGrowthCompany" xlink:to="dei_EntityEmergingGrowthCompany_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AccountingPoliciesTable" xlink:to="trex_AccountingPoliciesTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PaymentsToAcquireIntangibleAssets" xlink:to="us-gaap_PaymentsToAcquireIntangibleAssets_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_VestingDomain" xlink:to="us-gaap_VestingDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:to="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_WarrantyPeriod" xlink:to="trex_WarrantyPeriod_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PerformanceBasedRestrictedStockUnitsMember" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockSharesAuthorized" xlink:to="us-gaap_CommonStockSharesAuthorized_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="srt_ShareRepurchaseProgramDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" xlink:to="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:to="us-gaap_PropertyPlantAndEquipmentUsefulLife_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskByTypeAxis" xlink:to="us-gaap_ConcentrationRiskByTypeAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowancesAndReservesDeductions" xlink:to="us-gaap_ValuationAllowancesAndReservesDeductions_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" xlink:to="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtDisclosureAbstract" xlink:to="us-gaap_DebtDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentsIncorporatedByReferenceTextBlock" xlink:to="dei_DocumentsIncorporatedByReferenceTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" xlink:to="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock" xlink:to="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AmortizationOfIntangibleAssets" xlink:to="us-gaap_AmortizationOfIntangibleAssets_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:to="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:to="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RevenueRecognitionPolicyTextBlock" xlink:to="us-gaap_RevenueRecognitionPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CapitalExpenditure" xlink:to="trex_CapitalExpenditure_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GoodwillImpairmentLoss" xlink:to="us-gaap_GoodwillImpairmentLoss_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskRoleOfManagementTextBlock" xlink:to="cyd_CybersecurityRiskRoleOfManagementTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" xlink:to="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_AccountingPoliciesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SupplyCommitmentAxis" xlink:to="us-gaap_SupplyCommitmentAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCredit" xlink:to="us-gaap_LineOfCredit_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InsuranceSettlementMember" xlink:to="us-gaap_InsuranceSettlementMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_IncomeTaxDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_StockholdersEquityAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SupplyCommitmentArrangementMember" xlink:to="us-gaap_SupplyCommitmentArrangementMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract" xlink:to="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:to="us-gaap_PropertyPlantAndEquipmentTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PreferredStockSharesAuthorized" xlink:to="us-gaap_PreferredStockSharesAuthorized_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityFileNumber" xlink:to="dei_EntityFileNumber_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SegmentReportingDisclosureTextBlock" xlink:to="us-gaap_SegmentReportingDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RevenueFromContractWithCustomerAbstract" xlink:to="us-gaap_RevenueFromContractWithCustomerAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TransferredAtPointInTimeMember" xlink:to="us-gaap_TransferredAtPointInTimeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CreditAgreementSecondAmendmentMember" xlink:to="trex_CreditAgreementSecondAmendmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_StatementOfFinancialPositionAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_OperatingIncomeLoss_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InterestExpenseOperating" xlink:to="us-gaap_InterestExpenseOperating_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccruedIncomeTaxesCurrent" xlink:to="us-gaap_AccruedIncomeTaxesCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LetterOfCreditMember" xlink:to="us-gaap_LetterOfCreditMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityShellCompany" xlink:to="dei_EntityShellCompany_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_LineOfCreditFacilityTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityTaxIdentificationNumber" xlink:to="dei_EntityTaxIdentificationNumber_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_AssetsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_NumberOfSalesRetailers" xlink:to="trex_NumberOfSalesRetailers_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:to="us-gaap_FairValueOfFinancialInstrumentsPolicy_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityCurrentReportingStatus" xlink:to="dei_EntityCurrentReportingStatus_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AccruedManufacturingExpensesCurrent" xlink:to="trex_AccruedManufacturingExpensesCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:to="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_WarrantyReservesMember" xlink:to="us-gaap_WarrantyReservesMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SoftwareDevelopmentMember" xlink:to="us-gaap_SoftwareDevelopmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:to="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:to="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryDisclosureTextBlock" xlink:to="us-gaap_InventoryDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentFiscalYearFocus" xlink:to="dei_DocumentFiscalYearFocus_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PreferredStockValue" xlink:to="us-gaap_PreferredStockValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_CityAreaCode" xlink:to="dei_CityAreaCode_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_LiabilitiesCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SeasonalityDisclosureTextBlock" xlink:to="trex_SeasonalityDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LineOfCreditFacilityLenderDomain" xlink:to="us-gaap_LineOfCreditFacilityLenderDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LIFOInventoryAmount" xlink:to="us-gaap_LIFOInventoryAmount_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryNet" xlink:to="us-gaap_InventoryNet_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ProductWarrantyLiabilityTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryFinishedGoods" xlink:to="us-gaap_InventoryFinishedGoods_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" xlink:to="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract" xlink:to="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_LocalPhoneNumber" xlink:to="dei_LocalPhoneNumber_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PreferredStockSharesOutstanding" xlink:to="us-gaap_PreferredStockSharesOutstanding_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ResidentialPortfolioSegmentMember" xlink:to="us-gaap_ResidentialPortfolioSegmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" xlink:to="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncomeTaxPolicyTextBlock" xlink:to="us-gaap_IncomeTaxPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="us-gaap_CommitmentsAndContingenciesDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharesIssued" xlink:to="us-gaap_SharesIssued_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TreasuryStockValue" xlink:to="us-gaap_TreasuryStockValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CustomerOneMember" xlink:to="trex_CustomerOneMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:to="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyAccrualNoncurrent" xlink:to="us-gaap_StandardProductWarrantyAccrualNoncurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_GainLossOnInsuranceSettlement" xlink:to="trex_GainLossOnInsuranceSettlement_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseLiabilityCurrent" xlink:to="us-gaap_OperatingLeaseLiabilityCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PublicUtilitiesInventoryRawMaterialsMember" xlink:to="us-gaap_PublicUtilitiesInventoryRawMaterialsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" xlink:to="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentInterestRateStatedPercentage" xlink:to="us-gaap_DebtInstrumentInterestRateStatedPercentage_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RetainedEarningsMember" xlink:to="us-gaap_RetainedEarningsMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:to="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_DocumentTransitionReport" xlink:to="dei_DocumentTransitionReport_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PostemploymentBenefitsAbstract" xlink:to="us-gaap_PostemploymentBenefitsAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:to="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AccruedCapitalProjectsCurrent" xlink:to="trex_AccruedCapitalProjectsCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskCreditRisk" xlink:to="us-gaap_ConcentrationRiskCreditRisk_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_AuditorFirmId" xlink:to="dei_AuditorFirmId_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_MinimumMember" xlink:to="srt_MinimumMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" xlink:to="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockMember" xlink:to="us-gaap_CommonStockMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_EmployeeStockPurchasePlanMember" xlink:to="trex_EmployeeStockPurchasePlanMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:to="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AdditionalPaidInCapitalMember" xlink:to="us-gaap_AdditionalPaidInCapitalMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityWellKnownSeasonedIssuer" xlink:to="dei_EntityWellKnownSeasonedIssuer_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:to="trex_ScheduleOfStockAppreciationRightsActivityTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxLiabilitiesInventoriesAndOther" xlink:to="trex_DeferredTaxLiabilitiesInventoriesAndOther_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OtherAssetsNoncurrent" xlink:to="us-gaap_OtherAssetsNoncurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DescriptionOfOperatingLeasesWithInitialTerm" xlink:to="trex_DescriptionOfOperatingLeasesWithInitialTerm_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_PrepaidAdvertising" xlink:to="us-gaap_PrepaidAdvertising_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:to="us-gaap_ScheduleOfInventoryCurrentTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SignatureRailingAndTranscendCladdingMember" xlink:to="trex_SignatureRailingAndTranscendCladdingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OtherAssetsCurrent" xlink:to="us-gaap_OtherAssetsCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:to="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntityCommonStockSharesOutstanding" xlink:to="dei_EntityCommonStockSharesOutstanding_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_FinancialInstrumentsDisclosureTextBlock" xlink:to="us-gaap_FinancialInstrumentsDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" xlink:to="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DisaggregationOfRevenueLineItems" xlink:to="us-gaap_DisaggregationOfRevenueLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_BasisOfAccountingPolicyPolicyTextBlock" xlink:to="us-gaap_BasisOfAccountingPolicyPolicyTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" xlink:to="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommonStockValue" xlink:to="us-gaap_CommonStockValue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LinesOfCreditCurrent" xlink:to="us-gaap_LinesOfCreditCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GainLossOnDispositionOfAssets1" xlink:to="us-gaap_GainLossOnDispositionOfAssets1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_CustomerThreeMember" xlink:to="trex_CustomerThreeMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="us-gaap_ContingentConsiderationTypeDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="trex_ScheduleOfRestrictedStockActivityTable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseLiability" xlink:to="us-gaap_OperatingLeaseLiability_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" xlink:to="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommitmentsAndContingencies" xlink:to="us-gaap_CommitmentsAndContingencies_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_StandardProductWarrantyAccrualCurrent" xlink:to="us-gaap_StandardProductWarrantyAccrualCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:to="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccountsReceivableNetCurrent" xlink:to="us-gaap_AccountsReceivableNetCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CommercialPortfolioSegmentMember" xlink:to="us-gaap_CommercialPortfolioSegmentMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncreaseDecreaseInInventories" xlink:to="us-gaap_IncreaseDecreaseInInventories_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" xlink:to="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="us-gaap_ReportingUnitDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_FireAtVirginiaFacilityMember" xlink:to="trex_FireAtVirginiaFacilityMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_ConcentrationRiskBenchmarkDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_MaturityPeriodOfCashEquivalent" xlink:to="trex_MaturityPeriodOfCashEquivalent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="dei_EntitySmallBusiness" xlink:to="dei_EntitySmallBusiness_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" xlink:to="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SegmentReportingInformationLineItems_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:to="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DebtDisclosureTextBlock" xlink:to="us-gaap_DebtDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" xlink:to="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_TreasuryStockSharesAcquired" xlink:to="us-gaap_TreasuryStockSharesAcquired_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:to="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_CreditFacilityAxis" xlink:to="us-gaap_CreditFacilityAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RevolvingCreditFacilityMember" xlink:to="us-gaap_RevolvingCreditFacilityMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InventoryLIFOReserve" xlink:to="us-gaap_InventoryLIFOReserve_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SupplementalBalanceSheetInformationAbstract" xlink:to="trex_SupplementalBalanceSheetInformationAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_InternalRevenueServiceIRSMember" xlink:to="us-gaap_InternalRevenueServiceIRSMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock" xlink:to="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_UnusualOrInfrequentItemAxis" xlink:to="us-gaap_UnusualOrInfrequentItemAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" xlink:to="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_AgreementAxis" xlink:to="trex_AgreementAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" xlink:to="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_GainContingenciesByNatureAxis" xlink:to="us-gaap_GainContingenciesByNatureAxis_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_ResidentialUseMember" xlink:to="trex_ResidentialUseMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_DeferredTaxAssetsValuationAllowance" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_SurfaceFlakingMember" xlink:to="trex_SurfaceFlakingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:to="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_AccountsPayableCurrent" xlink:to="us-gaap_AccountsPayableCurrent_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" xlink:to="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="us-gaap_BuildingMember" xlink:to="us-gaap_BuildingMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_DomainNamesAndInternalUseSoftwareMember" xlink:to="trex_DomainNamesAndInternalUseSoftwareMember_lbl"/>
          <link:labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="trex_PresidentAndChiefExecutiveOfficerMember" xlink:to="trex_PresidentAndChiefExecutiveOfficerMember_lbl"/>
        </link:labelLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/CoverPage" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CoverAbstract" xlink:label="dei_CoverAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AmendmentFlag" xlink:label="dei_AmendmentFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFiscalYearFocus" xlink:label="dei_DocumentFiscalYearFocus"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentType" xlink:label="dei_DocumentType"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFiscalPeriodFocus" xlink:label="dei_DocumentFiscalPeriodFocus"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCentralIndexKey" xlink:label="dei_EntityCentralIndexKey"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CurrentFiscalYearEndDate" xlink:label="dei_CurrentFiscalYearEndDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentTransitionReport" xlink:label="dei_DocumentTransitionReport"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityRegistrantName" xlink:label="dei_EntityRegistrantName"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentPeriodEndDate" xlink:label="dei_DocumentPeriodEndDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCurrentReportingStatus" xlink:label="dei_EntityCurrentReportingStatus"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityInteractiveDataCurrent" xlink:label="dei_EntityInteractiveDataCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_TradingSymbol" xlink:label="dei_TradingSymbol"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityShellCompany" xlink:label="dei_EntityShellCompany"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityFilerCategory" xlink:label="dei_EntityFilerCategory"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntitySmallBusiness" xlink:label="dei_EntitySmallBusiness"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityEmergingGrowthCompany" xlink:label="dei_EntityEmergingGrowthCompany"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityCommonStockSharesOutstanding" xlink:label="dei_EntityCommonStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityFileNumber" xlink:label="dei_EntityFileNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityIncorporationStateCountryCode" xlink:label="dei_EntityIncorporationStateCountryCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityTaxIdentificationNumber" xlink:label="dei_EntityTaxIdentificationNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressAddressLine1" xlink:label="dei_EntityAddressAddressLine1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressCityOrTown" xlink:label="dei_EntityAddressCityOrTown"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressPostalZipCode" xlink:label="dei_EntityAddressPostalZipCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityAddressStateOrProvince" xlink:label="dei_EntityAddressStateOrProvince"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_CityAreaCode" xlink:label="dei_CityAreaCode"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_LocalPhoneNumber" xlink:label="dei_LocalPhoneNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_Security12bTitle" xlink:label="dei_Security12bTitle"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_SecurityExchangeName" xlink:label="dei_SecurityExchangeName"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentAnnualReport" xlink:label="dei_DocumentAnnualReport"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityWellKnownSeasonedIssuer" xlink:label="dei_EntityWellKnownSeasonedIssuer"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityVoluntaryFilers" xlink:label="dei_EntityVoluntaryFilers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_EntityPublicFloat" xlink:label="dei_EntityPublicFloat"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_IcfrAuditorAttestationFlag" xlink:label="dei_IcfrAuditorAttestationFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentFinStmtErrorCorrectionFlag" xlink:label="dei_DocumentFinStmtErrorCorrectionFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_DocumentsIncorporatedByReferenceTextBlock" xlink:label="dei_DocumentsIncorporatedByReferenceTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorName" xlink:label="dei_AuditorName"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorFirmId" xlink:label="dei_AuditorFirmId"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorLocation" xlink:label="dei_AuditorLocation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/dei/2024/dei-2024.xsd#dei_AuditorOpinionTextBlock" xlink:label="dei_AuditorOpinionTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_AmendmentFlag" order="49.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentFiscalYearFocus" order="50.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentType" order="51.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentFiscalPeriodFocus" order="52.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityCentralIndexKey" order="53.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_CurrentFiscalYearEndDate" order="54.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentTransitionReport" order="55.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityRegistrantName" order="56.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentPeriodEndDate" order="57.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityCurrentReportingStatus" order="58.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityInteractiveDataCurrent" order="59.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_TradingSymbol" order="60.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityShellCompany" order="61.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityFilerCategory" order="62.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntitySmallBusiness" order="63.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityEmergingGrowthCompany" order="64.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityCommonStockSharesOutstanding" order="65.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityFileNumber" order="66.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityIncorporationStateCountryCode" order="67.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityTaxIdentificationNumber" order="68.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityAddressAddressLine1" order="69.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityAddressCityOrTown" order="70.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityAddressPostalZipCode" order="71.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityAddressStateOrProvince" order="72.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_CityAreaCode" order="73.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_LocalPhoneNumber" order="74.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_Security12bTitle" order="75.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_SecurityExchangeName" order="76.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentAnnualReport" order="77.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityWellKnownSeasonedIssuer" order="78.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityVoluntaryFilers" order="79.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_EntityPublicFloat" order="80.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_IcfrAuditorAttestationFlag" order="81.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentFinStmtErrorCorrectionFlag" order="82.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_DocumentsIncorporatedByReferenceTextBlock" order="83.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_AuditorName" order="84.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_AuditorFirmId" order="85.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_AuditorLocation" order="86.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="dei_CoverAbstract" xlink:to="dei_AuditorOpinionTextBlock" order="87.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfComprehensiveIncome" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeStatementAbstract" xlink:label="us-gaap_IncomeStatementAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostOfGoodsAndServicesSold" xlink:label="us-gaap_CostOfGoodsAndServicesSold"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GrossProfit" xlink:label="us-gaap_GrossProfit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingIncomeLoss" xlink:label="us-gaap_OperatingIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeExpenseNet" xlink:label="us-gaap_InterestIncomeExpenseNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareBasic" xlink:label="us-gaap_EarningsPerShareBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareDiluted" xlink:label="us-gaap_EarningsPerShareDiluted"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_CostOfGoodsAndServicesSold" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_GrossProfit" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_OperatingIncomeLoss" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_InterestIncomeExpenseNet" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_NetIncomeLoss" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_EarningsPerShareBasic" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_EarningsPerShareDiluted" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" order="13" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeStatementAbstract" xlink:to="us-gaap_ComprehensiveIncomeNetOfTax" order="14" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheets" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsCurrentAbstract" xlink:label="us-gaap_AssetsCurrentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:label="us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrentAbstract" xlink:label="us-gaap_LiabilitiesCurrentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsPayableCurrent" xlink:label="us-gaap_AccountsPayableCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:label="us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityAbstract" xlink:label="us-gaap_StockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockValue" xlink:label="us-gaap_PreferredStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfFinancialPositionAbstract" xlink:label="us-gaap_StatementOfFinancialPositionAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsAbstract" xlink:label="us-gaap_AssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableNetCurrent" xlink:label="us-gaap_AccountsReceivableNetCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockValue" xlink:label="us-gaap_CommonStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryNet" xlink:label="us-gaap_InventoryNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualCurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalCommonStock" xlink:label="us-gaap_AdditionalPaidInCapitalCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LinesOfCreditCurrent" xlink:label="us-gaap_LinesOfCreditCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualNoncurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:label="us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsCurrent" xlink:label="us-gaap_AssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrent" xlink:label="us-gaap_LiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherLiabilitiesNoncurrent" xlink:label="us-gaap_OtherLiabilitiesNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockValue" xlink:label="us-gaap_TreasuryStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsNoncurrent" xlink:label="us-gaap_OtherAssetsNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Liabilities" xlink:label="us-gaap_Liabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets" xlink:label="us-gaap_Assets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingencies" xlink:label="us-gaap_CommitmentsAndContingencies"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_CashAndCashEquivalentsAtCarryingValue" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="us-gaap_AccountsPayableCurrent" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_LiabilitiesCurrentAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_PreferredStockValue" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_AssetsAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_AssetsCurrentAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_AccountsReceivableNetCurrent" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_DeferredIncomeTaxLiabilitiesNet" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_CommonStockValue" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_LiabilitiesAndStockholdersEquityAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_PropertyPlantAndEquipmentNet" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_InventoryNet" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="us-gaap_StandardProductWarrantyAccrualCurrent" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_AdditionalPaidInCapitalCommonStock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="us-gaap_LinesOfCreditCurrent" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_StandardProductWarrantyAccrualNoncurrent" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_RetainedEarningsAccumulatedDeficit" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_IntangibleAssetsNetIncludingGoodwill" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsCurrentAbstract" xlink:to="us-gaap_AssetsCurrent" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="us-gaap_LiabilitiesCurrent" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_OtherLiabilitiesNoncurrent" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_TreasuryStockValue" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_OtherAssetsNoncurrent" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_Liabilities" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityAbstract" xlink:to="us-gaap_StockholdersEquity" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAbstract" xlink:to="us-gaap_Assets" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_CommitmentsAndContingencies" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_StockholdersEquityAbstract" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="us-gaap_LiabilitiesAndStockholdersEquity" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheetsParenthetical" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfFinancialPositionAbstract" xlink:label="us-gaap_StatementOfFinancialPositionAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockParOrStatedValuePerShare" xlink:label="us-gaap_PreferredStockParOrStatedValuePerShare"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesAuthorized" xlink:label="us-gaap_PreferredStockSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesIssued" xlink:label="us-gaap_PreferredStockSharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockSharesOutstanding" xlink:label="us-gaap_PreferredStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockParOrStatedValuePerShare" xlink:label="us-gaap_CommonStockParOrStatedValuePerShare"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesAuthorized" xlink:label="us-gaap_CommonStockSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesIssued" xlink:label="us-gaap_CommonStockSharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockSharesOutstanding" xlink:label="us-gaap_CommonStockSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonShares" xlink:label="us-gaap_TreasuryStockCommonShares"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_PreferredStockParOrStatedValuePerShare" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_PreferredStockSharesAuthorized" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_PreferredStockSharesIssued" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_PreferredStockSharesOutstanding" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_CommonStockParOrStatedValuePerShare" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_CommonStockSharesAuthorized" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_CommonStockSharesIssued" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_CommonStockSharesOutstanding" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfFinancialPositionAbstract" xlink:to="us-gaap_TreasuryStockCommonShares" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfChangesInStockholdersEquity" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="us-gaap_StatementEquityComponentsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockMember" xlink:label="us-gaap_CommonStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfStockholdersEquityAbstract" xlink:label="us-gaap_StatementOfStockholdersEquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesIssued" xlink:label="us-gaap_SharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalMember" xlink:label="us-gaap_AdditionalPaidInCapitalMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsMember" xlink:label="us-gaap_RetainedEarningsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonMember" xlink:label="us-gaap_TreasuryStockCommonMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodValue" xlink:label="us-gaap_StockRepurchasedDuringPeriodValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockSharesAcquired" xlink:label="us-gaap_TreasuryStockSharesAcquired"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity_11"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesIssued" xlink:label="us-gaap_SharesIssued_12"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockholdersEquity" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_EquityComponentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_CommonStockMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfStockholdersEquityAbstract" xlink:to="us-gaap_StatementTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementEquityComponentsAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_SharesIssued" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_AdditionalPaidInCapitalMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_NetIncomeLoss" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_RetainedEarningsMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_TreasuryStockCommonMember" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockRepurchasedDuringPeriodValue" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_TreasuryStockSharesAcquired" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockholdersEquity_11" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_SharesIssued_12" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfCashFlows" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="us-gaap_DepreciationDepletionAndAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProfitLoss" xlink:label="us-gaap_ProfitLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementOfCashFlowsAbstract" xlink:label="us-gaap_StatementOfCashFlowsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplementalCashFlowInformationAbstract" xlink:label="us-gaap_SupplementalCashFlowInformationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestPaidNet" xlink:label="us-gaap_InterestPaidNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:label="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:label="us-gaap_IncreaseDecreaseInAccountsReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract" xlink:label="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CapitalExpendituresInAccountsPayable" xlink:label="trex_CapitalExpendituresInAccountsPayable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromLinesOfCredit" xlink:label="us-gaap_ProceedsFromLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquireIntangibleAssets" xlink:label="us-gaap_PaymentsToAcquireIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxesPaidNet" xlink:label="us-gaap_IncomeTaxesPaidNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInInventories" xlink:label="us-gaap_IncreaseDecreaseInInventories"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RepaymentsOfLinesOfCredit" xlink:label="us-gaap_RepaymentsOfLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensation" xlink:label="us-gaap_ShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsPayable" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:label="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:label="us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PaymentsForProceedsFromFinancingCosts" xlink:label="trex_PaymentsForProceedsFromFinancingCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherNoncashIncomeExpense" xlink:label="us-gaap_OtherNoncashIncomeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_5"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" xlink:label="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_DepreciationDepletionAndAmortization" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_ProfitLoss" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SupplementalCashFlowInformationAbstract" xlink:to="us-gaap_InterestPaidNet" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInAccountsReceivable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract" xlink:to="trex_CapitalExpendituresInAccountsPayable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_ProceedsFromLinesOfCredit" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_PaymentsToAcquireIntangibleAssets" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SupplementalCashFlowInformationAbstract" xlink:to="us-gaap_IncomeTaxesPaidNet" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInInventories" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_RepaymentsOfLinesOfCredit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_PaymentsForRepurchaseOfCommonStock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_ShareBasedCompensation" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivities" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInAccountsPayable" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_GainLossOnSaleOfPropertyPlantEquipment" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivities" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="trex_PaymentsForProceedsFromFinancingCosts" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsNoncashItemsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="us-gaap_OtherNoncashIncomeExpense" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_5" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncreaseDecreaseInOperatingAssetsAbstract" xlink:to="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivities" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_SupplementalCashFlowInformationAbstract" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementOfCashFlowsAbstract" xlink:to="us-gaap_CashFlowNoncashInvestingAndFinancingActivitiesDisclosureAbstract" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureCybersecurityRiskManagementStrategyAndGovernance" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedFlag" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskRoleOfManagementTextBlock" xlink:label="cyd_CybersecurityRiskRoleOfManagementTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" xlink:label="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" xlink:label="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:to="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedFlag" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:to="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskRoleOfManagementTextBlock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/ecd/2024/ecd-2024.xsd#ecd_InsiderTradingArrLineItems" xlink:label="ecd_InsiderTradingArrLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NonRule10B51ArrModifiedFlag" xlink:label="trex_NonRule10B51ArrModifiedFlag"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_Rule10B51ArrModifiedFlag" xlink:label="trex_Rule10B51ArrModifiedFlag"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="ecd_InsiderTradingArrLineItems" xlink:to="trex_NonRule10B51ArrModifiedFlag" order="14.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="ecd_InsiderTradingArrLineItems" xlink:to="trex_Rule10B51ArrModifiedFlag" order="15.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganization" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract" xlink:label="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NatureOfOperations" xlink:label="us-gaap_NatureOfOperations"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsAbstract" xlink:to="us-gaap_NatureOfOperations" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPolicies" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock" xlink:label="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_BasisOfPresentationAndSignificantAccountingPoliciesTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsInc" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TrexCommercialProductsIncMember" xlink:label="trex_TrexCommercialProductsIncMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RelatedPartyDomain" xlink:to="trex_TrexCommercialProductsIncMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:to="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/Inventories" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureAbstract" xlink:label="us-gaap_InventoryDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureTextBlock" xlink:label="us-gaap_InventoryDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssets" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TextBlockAbstract" xlink:label="us-gaap_TextBlockAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" xlink:label="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TextBlockAbstract" xlink:to="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNet" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:to="us-gaap_GoodwillAndIntangibleAssetsDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipment" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentAbstract" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilities" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PayablesAndAccrualsAbstract" xlink:label="us-gaap_PayablesAndAccrualsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock" xlink:label="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_AccountsPayableAccruedLiabilitiesAndOtherLiabilitiesDisclosureCurrentTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/Debt" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtDisclosureAbstract" xlink:label="us-gaap_DebtDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtDisclosureTextBlock" xlink:label="us-gaap_DebtDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DebtDisclosureAbstract" xlink:to="us-gaap_DebtDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/Leases" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeasesTextBlock" xlink:label="us-gaap_LesseeOperatingLeasesTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_LesseeOperatingLeasesTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/FinancialInstruments" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InvestmentsAllOtherInvestmentsAbstract" xlink:label="us-gaap_InvestmentsAllOtherInvestmentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancialInstrumentsDisclosureTextBlock" xlink:label="us-gaap_FinancialInstrumentsDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InvestmentsAllOtherInvestmentsAbstract" xlink:to="us-gaap_FinancialInstrumentsDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquity" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:label="us-gaap_StockholdersEquityNoteDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_StockholdersEquityNoteDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomers" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerAbstract" xlink:label="us-gaap_RevenueFromContractWithCustomerAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:label="us-gaap_RevenueFromContractWithCustomerTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RevenueFromContractWithCustomerAbstract" xlink:to="us-gaap_RevenueFromContractWithCustomerTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensation" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlans" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PostemploymentBenefitsAbstract" xlink:label="us-gaap_PostemploymentBenefitsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock" xlink:label="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PostemploymentBenefitsAbstract" xlink:to="us-gaap_CompensationAndEmployeeBenefitPlansOtherThanShareBasedCompensationTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxes" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureTextBlock" xlink:label="us-gaap_IncomeTaxDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_IncomeTaxDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformation" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingAbstract" xlink:label="us-gaap_SegmentReportingAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingDisclosureTextBlock" xlink:label="us-gaap_SegmentReportingDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="us-gaap_SegmentReportingDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/Seasonality" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TextBlockAbstract" xlink:label="us-gaap_TextBlockAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SeasonalityDisclosureTextBlock" xlink:label="trex_SeasonalityDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TextBlockAbstract" xlink:to="trex_SeasonalityDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingencies" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReserves" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsAbstract" xlink:label="srt_ValuationAndQualifyingAccountsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:label="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsAbstract" xlink:to="srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesPolicies" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BasisOfAccountingPolicyPolicyTextBlock" xlink:label="us-gaap_BasisOfAccountingPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UseOfEstimates" xlink:label="us-gaap_UseOfEstimates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:label="us-gaap_CashAndCashEquivalentsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskCreditRisk" xlink:label="us-gaap_ConcentrationRiskCreditRisk"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryPolicyTextBlock" xlink:label="us-gaap_InventoryPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeLeasesPolicyTextBlock" xlink:label="us-gaap_LesseeLeasesPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FairValueMeasurementPolicyPolicyTextBlock" xlink:label="us-gaap_FairValueMeasurementPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:label="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyPolicy" xlink:label="us-gaap_StandardProductWarrantyPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityPolicyTextBlock" xlink:label="us-gaap_StockholdersEquityPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueRecognitionPolicyTextBlock" xlink:label="us-gaap_RevenueRecognitionPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_InsuranceProceedsPolicyTextBlock" xlink:label="trex_InsuranceProceedsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:label="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxPolicyTextBlock" xlink:label="us-gaap_IncomeTaxPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResearchAndDevelopmentExpensePolicy" xlink:label="us-gaap_ResearchAndDevelopmentExpensePolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdvertisingCostsPolicyTextBlock" xlink:label="us-gaap_AdvertisingCostsPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:label="us-gaap_FairValueOfFinancialInstrumentsPolicy"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:label="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock" xlink:label="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_BasisOfAccountingPolicyPolicyTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_UseOfEstimates" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_CashAndCashEquivalentsPolicyTextBlock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_ConcentrationRiskCreditRisk" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_InventoryPolicyTextBlock" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_LesseeLeasesPolicyTextBlock" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_FairValueMeasurementPolicyPolicyTextBlock" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_StandardProductWarrantyPolicy" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_StockholdersEquityPolicyTextBlock" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_RevenueRecognitionPolicyTextBlock" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="trex_InsuranceProceedsPolicyTextBlock" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" order="13" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_IncomeTaxPolicyTextBlock" order="14" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_ResearchAndDevelopmentExpensePolicy" order="15" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_AdvertisingCostsPolicyTextBlock" order="16" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_FairValueOfFinancialInstrumentsPolicy" order="17" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" order="18" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock" order="19" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" xlink:label="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/InventoriesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureAbstract" xlink:label="us-gaap_InventoryDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:label="us-gaap_ScheduleOfInventoryCurrentTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_ScheduleOfInventoryCurrentTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TextBlockAbstract" xlink:label="us-gaap_TextBlockAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" xlink:label="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TextBlockAbstract" xlink:to="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentAbstract" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:label="us-gaap_PropertyPlantAndEquipmentTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="us-gaap_PropertyPlantAndEquipmentTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PayablesAndAccrualsAbstract" xlink:label="us-gaap_PayablesAndAccrualsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" xlink:label="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" xlink:label="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock" xlink:label="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_ScheduleOfEarningsPerShareBasicAndDilutedTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerAbstract" xlink:label="us-gaap_RevenueFromContractWithCustomerAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:label="us-gaap_DisaggregationOfRevenueTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RevenueFromContractWithCustomerAbstract" xlink:to="us-gaap_DisaggregationOfRevenueTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" xlink:label="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:label="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="us-gaap_StatementTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" order="4.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:label="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:label="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:label="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformationTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingAbstract" xlink:label="us-gaap_SegmentReportingAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" xlink:label="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesTables" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:label="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/BusinessAndOrganizationAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NumberOfReportableSegments" xlink:label="us-gaap_NumberOfReportableSegments"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_NumberOfReportableSegments" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductOrServiceAxis" xlink:label="srt_ProductOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:label="us-gaap_ConcentrationRiskByBenchmarkAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="us-gaap_ConcentrationRiskTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CustomerConcentrationRiskMember" xlink:label="us-gaap_CustomerConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MajorCustomersAxis" xlink:label="srt_MajorCustomersAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_NameOfMajorCustomerDomain" xlink:label="srt_NameOfMajorCustomerDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingMember" xlink:label="trex_SignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsByNatureAxis" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="us-gaap_SubsequentEventTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerOneMember" xlink:label="trex_CustomerOneMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_MaturityPeriodOfCashEquivalent" xlink:label="trex_MaturityPeriodOfCashEquivalent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingencyNatureDomain" xlink:label="us-gaap_GainContingencyNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InsuranceSettlementMember" xlink:label="us-gaap_InsuranceSettlementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemDomain" xlink:label="us-gaap_UnusualOrInfrequentItemDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FireAtVirginiaFacilityMember" xlink:label="trex_FireAtVirginiaFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccountingPoliciesTable" xlink:label="trex_AccountingPoliciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="us-gaap_TypeOfAdoptionMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeaseholdImprovementsMember" xlink:label="us-gaap_LeaseholdImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CommercialUseMember" xlink:label="trex_CommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:label="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByTypeAxis" xlink:label="us-gaap_ConcentrationRiskByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_EquityMethodInvesteeNameDomain" xlink:label="srt_EquityMethodInvesteeNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitAxis" xlink:label="us-gaap_ReportingUnitAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RailingMember" xlink:label="trex_RailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SalesRevenueNetMember" xlink:label="us-gaap_SalesRevenueNetMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FourLargestSuppliersMember" xlink:label="trex_FourLargestSuppliersMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemAxis" xlink:label="us-gaap_UnusualOrInfrequentItemAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingenciesByNatureAxis" xlink:label="us-gaap_GainContingenciesByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplierConcentrationRiskMember" xlink:label="us-gaap_SupplierConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TranscendDeckingMember" xlink:label="trex_TranscendDeckingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerTwoMember" xlink:label="trex_CustomerTwoMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfFinancialInstitutionWithDeposit" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialUseMember" xlink:label="trex_ResidentialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StagingMember" xlink:label="trex_StagingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableMember" xlink:label="us-gaap_AccountsReceivableMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SelectDeckingAndUniversalFasciaMember" xlink:label="trex_SelectDeckingAndUniversalFasciaMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerThreeMember" xlink:label="trex_CustomerThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PublicUtilitiesInventoryRawMaterialsMember" xlink:label="us-gaap_PublicUtilitiesInventoryRawMaterialsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskPercentage1" xlink:label="us-gaap_ConcentrationRiskPercentage1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingAndTranscendCladdingMember" xlink:label="trex_SignatureRailingAndTranscendCladdingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfLargestRawMaterialSuppliers" xlink:label="trex_NumberOfLargestRawMaterialSuppliers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryLIFOReserve" xlink:label="us-gaap_InventoryLIFOReserve"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="us-gaap_GoodwillImpairmentLoss"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_WarrantyPeriod" xlink:label="trex_WarrantyPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResearchAndDevelopmentExpense" xlink:label="us-gaap_ResearchAndDevelopmentExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidAdvertising" xlink:label="us-gaap_PrepaidAdvertising"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdvertisingExpense" xlink:label="us-gaap_AdvertisingExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LessorOperatingLeaseTermOfContract" xlink:label="us-gaap_LessorOperatingLeaseTermOfContract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DescriptionOfOperatingLeasesWithInitialTerm" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GainLossOnInsuranceSettlement" xlink:label="trex_GainLossOnInsuranceSettlement"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductsAndServicesDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:to="us-gaap_ConcentrationRiskBenchmarkDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskTypeDomain" xlink:to="us-gaap_CustomerConcentrationRiskMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_MajorCustomersAxis" xlink:to="srt_NameOfMajorCustomerDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsNatureDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerOneMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_MaturityPeriodOfCashEquivalent" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GainContingencyNatureDomain" xlink:to="us-gaap_InsuranceSettlementMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_UnusualOrInfrequentItemDomain" xlink:to="trex_FireAtVirginiaFacilityMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="trex_AccountingPoliciesTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:to="us-gaap_TypeOfAdoptionMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_LeaseholdImprovementsMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_CommercialUseMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskByTypeAxis" xlink:to="us-gaap_ConcentrationRiskTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:to="srt_EquityMethodInvesteeNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_RailingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_SalesRevenueNetMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:to="trex_FourLargestSuppliersMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_UnusualOrInfrequentItemAxis" xlink:to="us-gaap_UnusualOrInfrequentItemDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GainContingenciesByNatureAxis" xlink:to="us-gaap_GainContingencyNatureDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskTypeDomain" xlink:to="us-gaap_SupplierConcentrationRiskMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_TranscendDeckingMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerTwoMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfFinancialInstitutionWithDeposit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialUseMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ConcentrationRiskByBenchmarkAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_StagingMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_AccountsReceivableMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SelectDeckingAndUniversalFasciaMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerThreeMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ConcentrationRiskByTypeAxis" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_PublicUtilitiesInventoryRawMaterialsMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_ConcentrationRiskPercentage1" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_MajorCustomersAxis" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingAndTranscendCladdingMember" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_GuaranteeObligationsByNatureAxis" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_RangeAxis" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfLargestRawMaterialSuppliers" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_ProductOrServiceAxis" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_InventoryLIFOReserve" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_GoodwillImpairmentLoss" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_WarrantyPeriod" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ReportingUnitAxis" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_UnusualOrInfrequentItemAxis" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_ResearchAndDevelopmentExpense" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_GainContingenciesByNatureAxis" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_PrepaidAdvertising" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_AdvertisingExpense" order="13" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_SubsequentEventTypeAxis" order="13" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_LessorOperatingLeaseTermOfContract" order="14" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" order="14" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_DescriptionOfOperatingLeasesWithInitialTerm" order="15" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AccountingPoliciesTable" xlink:to="trex_ScheduleOfSignificantAccountingPoliciesLineItems" order="15" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_GainLossOnInsuranceSettlement" order="16" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentUsefulLife" order="17" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingMember" xlink:label="us-gaap_BuildingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountingPoliciesAbstract" xlink:label="us-gaap_AccountingPoliciesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="us-gaap_MachineryAndEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FurnitureAndFixturesMember" xlink:label="us-gaap_FurnitureAndFixturesMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ForkliftsAndTractorsMember" xlink:label="trex_ForkliftsAndTractorsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComputerEquipmentMember" xlink:label="us-gaap_ComputerEquipmentMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentUsefulLife" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="srt_RangeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_BuildingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AccountingPoliciesAbstract" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_MachineryAndEquipmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_FurnitureAndFixturesMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="trex_ForkliftsAndTractorsMember" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ComputerEquipmentMember" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsIncAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TrexCommercialProductsIncMember" xlink:label="trex_TrexCommercialProductsIncMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RelatedPartyDomain" xlink:to="trex_TrexCommercialProductsIncMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" xlink:to="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/InventoriesSummaryOfInventoriesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryDisclosureAbstract" xlink:label="us-gaap_InventoryDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryFinishedGoods" xlink:label="us-gaap_InventoryFinishedGoods"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryRawMaterials" xlink:label="us-gaap_InventoryRawMaterials"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryGross" xlink:label="us-gaap_InventoryGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryLIFOReserve" xlink:label="us-gaap_InventoryLIFOReserve"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LIFOInventoryAmount" xlink:label="us-gaap_LIFOInventoryAmount"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryFinishedGoods" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryRawMaterials" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryGross" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_InventoryLIFOReserve" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTerseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_InventoryDisclosureAbstract" xlink:to="us-gaap_LIFOInventoryAmount" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseCurrent" xlink:label="us-gaap_PrepaidExpenseCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxesReceivable" xlink:label="us-gaap_IncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsCurrent" xlink:label="us-gaap_OtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:to="us-gaap_PrepaidExpenseCurrent" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:to="us-gaap_IncomeTaxesReceivable" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:to="us-gaap_OtherAssetsCurrent" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsAbstract" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfGoodwillTable" xlink:label="us-gaap_ScheduleOfGoodwillTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternetDomainNamesMember" xlink:label="us-gaap_InternetDomainNamesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillLineItems" xlink:label="us-gaap_GoodwillLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Goodwill" xlink:label="us-gaap_Goodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitAxis" xlink:label="us-gaap_ReportingUnitAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:label="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RailingMember" xlink:label="trex_RailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SoftwareDevelopmentMember" xlink:label="us-gaap_SoftwareDevelopmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:label="us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StagingMember" xlink:label="trex_StagingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DomainNamesAndInternalUseSoftwareMember" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AmortizationOfIntangibleAssets" xlink:label="us-gaap_AmortizationOfIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsGrossExcludingGoodwill" xlink:label="us-gaap_IntangibleAssetsGrossExcludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="us-gaap_GoodwillImpairmentLoss"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_InternetDomainNamesMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_Goodwill" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:to="us-gaap_ScheduleOfGoodwillTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_RailingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_SoftwareDevelopmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_FiniteLivedIntangibleAssetUsefulLife" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_StagingMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="trex_DomainNamesAndInternalUseSoftwareMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_AmortizationOfIntangibleAssets" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_ReportingUnitAxis" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_IntangibleAssetsGrossExcludingGoodwill" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_GoodwillLineItems" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_GoodwillImpairmentLoss" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="us-gaap_MachineryAndEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentAbstract" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingAndBuildingImprovementsMember" xlink:label="us-gaap_BuildingAndBuildingImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ForkliftsAndTractorsMember" xlink:label="trex_ForkliftsAndTractorsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComputerEquipmentMember" xlink:label="us-gaap_ComputerEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FurnitureAndFixturesMember" xlink:label="us-gaap_FurnitureAndFixturesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConstructionInProgressMember" xlink:label="us-gaap_ConstructionInProgressMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandMember" xlink:label="us-gaap_LandMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_MachineryAndEquipmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_BuildingAndBuildingImprovementsMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentNet" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="trex_ForkliftsAndTractorsMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ComputerEquipmentMember" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_FurnitureAndFixturesMember" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ConstructionInProgressMember" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_LandMember" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConstructionInProgressMember" xlink:label="us-gaap_ConstructionInProgressMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentAbstract" xlink:label="us-gaap_PropertyPlantAndEquipmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Depreciation" xlink:label="us-gaap_Depreciation"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ConstructionInProgressMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_Depreciation" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PayablesAndAccrualsAbstract" xlink:label="us-gaap_PayablesAndAccrualsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedMarketingCostsCurrent" xlink:label="us-gaap_AccruedMarketingCostsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedCapitalProjectsCurrent" xlink:label="trex_AccruedCapitalProjectsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityCurrent" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedManufacturingExpensesCurrent" xlink:label="trex_AccruedManufacturingExpensesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedIncomeTaxesCurrent" xlink:label="us-gaap_AccruedIncomeTaxesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAccruedLiabilitiesCurrent" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList" xlink:label="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_AccruedMarketingCostsCurrent" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_EmployeeRelatedLiabilitiesCurrent" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="trex_AccruedCapitalProjectsCurrent" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_OperatingLeaseLiabilityCurrent" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="trex_AccruedManufacturingExpensesCurrent" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_AccruedIncomeTaxesCurrent" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_OtherAccruedLiabilitiesCurrent" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PayablesAndAccrualsAbstract" xlink:to="us-gaap_OperatingLeaseLiabilityCurrentStatementOfFinancialPositionExtensibleList" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/DebtAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityAxis" xlink:label="us-gaap_LineOfCreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="us-gaap_LineOfCreditFacilityLenderDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateDomain" xlink:label="us-gaap_VariableRateDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BaseRateMember" xlink:label="us-gaap_BaseRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneAxis" xlink:label="trex_CreditFacilityOneAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneDomain" xlink:label="trex_CreditFacilityOneDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLineItems" xlink:label="us-gaap_LineOfCreditFacilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityDomain" xlink:label="us-gaap_CreditFacilityDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="us-gaap_RevolvingCreditFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateAxis" xlink:label="us-gaap_VariableRateAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementDomain" xlink:label="trex_AgreementDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FifthAmendmentAndRestatedAgreementMember" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LetterOfCreditMember" xlink:label="us-gaap_LetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtDisclosureAbstract" xlink:label="us-gaap_DebtDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityTable" xlink:label="us-gaap_LineOfCreditFacilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityAxis" xlink:label="us-gaap_CreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementAxis" xlink:label="trex_AgreementAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" xlink:label="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingBLoanMember" xlink:label="trex_RevolvingBLoanMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditAgreementSecondAmendmentMember" xlink:label="trex_CreditAgreementSecondAmendmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SwinglineLetterOfCreditMember" xlink:label="trex_SwinglineLetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentAxis" xlink:label="us-gaap_DebtInstrumentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="us-gaap_DebtInstrumentNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityExpirationDate1" xlink:label="us-gaap_LineOfCreditFacilityExpirationDate1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingALoansMember" xlink:label="trex_RevolvingALoansMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentMaturityDate" xlink:label="us-gaap_DebtInstrumentMaturityDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:label="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LinesOfCreditCurrent" xlink:label="us-gaap_LinesOfCreditCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LineOfCreditFacilityAdditionalBorrowingCapacity" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" xlink:label="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCredit" xlink:label="us-gaap_LineOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage" xlink:label="us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtWeightedAverageInterestRate" xlink:label="us-gaap_DebtWeightedAverageInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityAxis" xlink:to="us-gaap_LineOfCreditFacilityLenderDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_VariableRateDomain" xlink:to="us-gaap_BaseRateMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_CreditFacilityOneAxis" xlink:to="trex_CreditFacilityOneDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="us-gaap_RevolvingCreditFacilityMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_VariableRateAxis" xlink:to="us-gaap_VariableRateDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AgreementDomain" xlink:to="trex_FifthAmendmentAndRestatedAgreementMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_CreditFacilityOneDomain" xlink:to="us-gaap_LetterOfCreditMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DebtDisclosureAbstract" xlink:to="us-gaap_LineOfCreditFacilityTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_CreditFacilityAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CreditFacilityAxis" xlink:to="us-gaap_CreditFacilityDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AgreementAxis" xlink:to="trex_AgreementDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_VariableRateDomain" xlink:to="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="trex_RevolvingBLoanMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_AgreementDomain" xlink:to="trex_CreditAgreementSecondAmendmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_CreditFacilityOneDomain" xlink:to="trex_SwinglineLetterOfCreditMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_DebtInstrumentAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DebtInstrumentAxis" xlink:to="us-gaap_DebtInstrumentNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityExpirationDate1" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="trex_RevolvingALoansMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_VariableRateAxis" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentMaturityDate" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_LineOfCreditFacilityAxis" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="trex_AgreementAxis" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LinesOfCreditCurrent" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="trex_CreditFacilityOneAxis" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="trex_LineOfCreditFacilityAdditionalBorrowingCapacity" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="srt_RangeAxis" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_LineOfCreditFacilityLineItems" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCredit" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentInterestRateStatedPercentage" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtWeightedAverageInterestRate" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:label="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseCost" xlink:label="us-gaap_OperatingLeaseCost"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:label="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_StatementTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="srt_RangeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseCost" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:label="us-gaap_CashFlowOperatingActivitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:label="us-gaap_AssetsAndLiabilitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeasePayments" xlink:label="us-gaap_OperatingLeasePayments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SupplementalBalanceSheetInformationAbstract" xlink:label="trex_SupplementalBalanceSheetInformationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" xlink:label="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:to="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:to="us-gaap_OperatingLeasePayments" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_StatementTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_SupplementalBalanceSheetInformationAbstract" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="trex_SupplementalBalanceSheetInformationAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:to="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_AssetsAndLiabilitiesLesseeAbstract" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseLiability" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:label="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeasesAbstract" xlink:label="us-gaap_LeasesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LeasesAbstract" xlink:to="us-gaap_StatementTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_OperatingLeaseLiability" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfTreasuryStockTable" xlink:label="us-gaap_ClassOfTreasuryStockTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramAxis" xlink:label="srt_ShareRepurchaseProgramAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityClassOfTreasuryStockLineItems" xlink:label="us-gaap_EquityClassOfTreasuryStockLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" xlink:label="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="us-gaap_StatementEquityComponentsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockMember" xlink:label="us-gaap_CommonStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramDomain" xlink:label="srt_ShareRepurchaseProgramDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockRepurchaseProgramMember" xlink:label="trex_StockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockSharesAcquired" xlink:label="us-gaap_TreasuryStockSharesAcquired"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandEighteenStockRepurchaseProgramMember" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodShares" xlink:label="us-gaap_StockRepurchasedDuringPeriodShares"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="srt_ShareRepurchaseProgramAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_EquityComponentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_CommonStockMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_ClassOfTreasuryStockTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ShareRepurchaseProgramAxis" xlink:to="srt_ShareRepurchaseProgramDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_StockRepurchaseProgramMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="us-gaap_StatementEquityComponentsAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_TreasuryStockSharesAcquired" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_TwoThousandEighteenStockRepurchaseProgramMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="us-gaap_EquityClassOfTreasuryStockLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_StockRepurchasedDuringPeriodShares" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:label="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" xlink:label="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLossAbstract" xlink:label="us-gaap_NetIncomeLossAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquityNoteAbstract" xlink:label="us-gaap_StockholdersEquityNoteAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockAppreciationRightsMember" xlink:label="trex_StockAppreciationRightsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareBasic" xlink:label="us-gaap_EarningsPerShareBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RestrictedStockMember" xlink:label="us-gaap_RestrictedStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareDiluted" xlink:label="us-gaap_EarningsPerShareDiluted"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:to="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_NetIncomeLossAbstract" xlink:to="us-gaap_NetIncomeLoss" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_StockholdersEquityNoteAbstract" xlink:to="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_NetIncomeLossAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:to="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:to="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_StockAppreciationRightsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_EarningsPerShareBasic" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_RestrictedStockMember" order="4.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_EarningsPerShareDiluted" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesNameDomain" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityAbstract" xlink:label="us-gaap_EquityAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RestrictedStockMember" xlink:label="us-gaap_RestrictedStockMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:to="us-gaap_AntidilutiveSecuritiesNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_EquityAbstract" xlink:to="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="us-gaap_RestrictedStockMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredAtPointInTimeMember" xlink:label="us-gaap_TransferredAtPointInTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueTable" xlink:label="us-gaap_DisaggregationOfRevenueTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueAbstract" xlink:label="us-gaap_DisaggregationOfRevenueAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueLineItems" xlink:label="us-gaap_DisaggregationOfRevenueLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredOverTimeMember" xlink:label="us-gaap_TransferredOverTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:to="us-gaap_TransferredAtPointInTimeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisaggregationOfRevenueAbstract" xlink:to="us-gaap_DisaggregationOfRevenueTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisaggregationOfRevenueLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:to="us-gaap_TransferredOverTimeMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_DisaggregationOfRevenueLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandFourteenStockIncentivePlanMember" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameAxis" xlink:label="us-gaap_PlanNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingAxis" xlink:label="us-gaap_VestingAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingDomain" xlink:label="us-gaap_VestingDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" xlink:label="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EmployeeStockPurchasePlanMember" xlink:label="trex_EmployeeStockPurchasePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockIssuedSharesEmployeeStockPurchasePlan" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" xlink:label="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PlanNameDomain" xlink:to="trex_TwoThousandFourteenStockIncentivePlanMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_VestingAxis" xlink:to="us-gaap_VestingDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="srt_RangeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_AwardTypeAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_VestingAxis" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_PlanNameAxis" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" order="4.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" order="5.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" order="6.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_EmployeeStockPurchasePlanMember" order="7.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_StockIssuedSharesEmployeeStockPurchasePlan" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AllocatedShareBasedCompensationExpense" xlink:label="us-gaap_AllocatedShareBasedCompensationExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EmployeeStockPurchasePlanMember" xlink:label="trex_EmployeeStockPurchasePlanMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_AllocatedShareBasedCompensationExpense" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" order="4.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" order="5.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_EmployeeStockPurchasePlanMember" order="6.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityLineItems" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityTable" xlink:label="trex_ScheduleOfRestrictedStockActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_4"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_9"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="trex_ScheduleOfRestrictedStockActivityTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="trex_ScheduleOfRestrictedStockActivityLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTerseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTerseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_4" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" order="4.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_9" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityLineItems" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityTable" xlink:label="trex_ScheduleOfRestrictedStockActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_4"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_9"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="trex_ScheduleOfRestrictedStockActivityTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="trex_ScheduleOfRestrictedStockActivityLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_4" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_9" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSarActivityDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:label="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_4"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_11"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="trex_ScheduleOfStockAppreciationRightsActivityTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:to="us-gaap_AwardTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:to="trex_ScheduleOfStockAppreciationRightsActivityLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" order="2.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" order="3.0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber_4" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice_11" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" order="12" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" order="13" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" order="14" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" order="15" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" order="16" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" order="17" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" order="18" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" order="19" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlansAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameAxis" xlink:label="us-gaap_PlanNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:label="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="us-gaap_SubsequentEventTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:label="us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedContributionPlanCostRecognized" xlink:label="us-gaap_DefinedContributionPlanCostRecognized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:label="us-gaap_CompensationAndRetirementDisclosureAbstract"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_PlanNameAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:to="us-gaap_DefinedContributionPlanCostRecognized" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:to="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_SubsequentEventTypeAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_DefinedBenefitPlanDisclosureLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesIncomeTaxProvisionBenefitDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentFederalTaxExpenseBenefit" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_CurrentFederalTaxExpenseBenefit" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_DeferredFederalIncomeTaxExpenseBenefit" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_CurrentStateAndLocalTaxExpenseBenefit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefit" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:label="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" xlink:label="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" xlink:label="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationNondeductibleExpense" xlink:label="us-gaap_IncomeTaxReconciliationNondeductibleExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxSettlements" xlink:label="us-gaap_IncomeTaxReconciliationTaxSettlements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxCredits" xlink:label="us-gaap_IncomeTaxReconciliationTaxCredits"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationOtherAdjustments" xlink:label="us-gaap_IncomeTaxReconciliationOtherAdjustments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationNondeductibleExpense" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationTaxSettlements" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationTaxCredits" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxReconciliationOtherAdjustments" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxExpenseBenefitContinuingOperationsIncomeTaxReconciliationAbstract" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:label="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesDepreciation" xlink:label="trex_DeferredTaxLiabilitiesDepreciation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:label="us-gaap_ComponentsOfDeferredTaxAssetsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsOperatingLeaseLiabilities" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" xlink:label="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesGoodwillAmortization" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsDeferredIncome" xlink:label="us-gaap_DeferredTaxAssetsDeferredIncome"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesInventoriesAndOther" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilities" xlink:label="us-gaap_DeferredIncomeTaxLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsInventory" xlink:label="us-gaap_DeferredTaxAssetsInventory"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOther" xlink:label="us-gaap_DeferredTaxAssetsOther"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsGross" xlink:label="us-gaap_DeferredTaxAssetsGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsNet" xlink:label="us-gaap_DeferredTaxAssetsNet"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="trex_DeferredTaxLiabilitiesDepreciation" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="trex_DeferredTaxAssetsOperatingLeaseLiabilities" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="trex_DeferredTaxLiabilitiesGoodwillAmortization" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsDeferredIncome" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="trex_DeferredTaxLiabilitiesInventoriesAndOther" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="us-gaap_DeferredIncomeTaxLiabilities" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTotalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxLiabilitiesAbstract" xlink:to="us-gaap_DeferredIncomeTaxLiabilitiesNet" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTotalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsInventory" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsOther" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsGross" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ComponentsOfDeferredTaxAssetsAbstract" xlink:to="us-gaap_DeferredTaxAssetsNet" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/totalLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="us-gaap_IncomeTaxAuthorityNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternalRevenueServiceIRSMember" xlink:label="us-gaap_InternalRevenueServiceIRSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyLineItems" xlink:label="us-gaap_IncomeTaxContingencyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyTable" xlink:label="us-gaap_IncomeTaxContingencyTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodAxis" xlink:label="us-gaap_TaxPeriodAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodDomain" xlink:label="us-gaap_TaxPeriodDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarliestTaxYearMember" xlink:label="us-gaap_EarliestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameAxis" xlink:label="us-gaap_IncomeTaxAuthorityNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxDisclosureAbstract" xlink:label="us-gaap_IncomeTaxDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LatestTaxYearMember" xlink:label="us-gaap_LatestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnrecognizedTaxBenefits" xlink:label="us-gaap_UnrecognizedTaxBenefits"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnrecognizedTaxBenefits" xlink:label="us-gaap_UnrecognizedTaxBenefits_4"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OpenTaxYear" xlink:label="us-gaap_OpenTaxYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxAuthorityNameDomain" xlink:to="us-gaap_InternalRevenueServiceIRSMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_TaxPeriodAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TaxPeriodDomain" xlink:to="us-gaap_EarliestTaxYearMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TaxPeriodAxis" xlink:to="us-gaap_TaxPeriodDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxAuthorityNameAxis" xlink:to="us-gaap_IncomeTaxAuthorityNameDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxDisclosureAbstract" xlink:to="us-gaap_IncomeTaxContingencyTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_IncomeTaxAuthorityNameAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_TaxPeriodDomain" xlink:to="us-gaap_LatestTaxYearMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_UnrecognizedTaxBenefits" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_IncomeTaxContingencyLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_UnrecognizedTaxBenefits_4" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_OpenTaxYear" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_EffectiveIncomeTaxRateContinuingOperations" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformationAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntersegmentEliminationMember" xlink:label="us-gaap_IntersegmentEliminationMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingAbstract" xlink:label="us-gaap_SegmentReportingAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsAxis" xlink:label="srt_ConsolidationItemsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="us-gaap_SegmentReportingInformationLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NumberOfReportableSegments" xlink:label="us-gaap_NumberOfReportableSegments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfSalesRetailers" xlink:label="trex_NumberOfSalesRetailers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" xlink:label="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" xlink:label="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnDispositionOfAssets1" xlink:label="us-gaap_GainLossOnDispositionOfAssets1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ConsolidationItemsDomain" xlink:to="us-gaap_IntersegmentEliminationMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_NumberOfReportableSegments" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="srt_ConsolidationItemsAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_NumberOfSalesRetailers" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_SegmentReportingInformationLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainLossOnDispositionOfAssets1" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTerseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformationDetailsOfSegmentInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingSegmentsMember" xlink:label="us-gaap_OperatingSegmentsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingAbstract" xlink:label="us-gaap_SegmentReportingAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsAxis" xlink:label="srt_ConsolidationItemsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="us-gaap_SegmentReportingInformationLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostOfGoodsAndServicesSold" xlink:label="us-gaap_CostOfGoodsAndServicesSold"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="us-gaap_DepreciationDepletionAndAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeOperating" xlink:label="us-gaap_InterestIncomeOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestExpenseOperating" xlink:label="us-gaap_InterestExpenseOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EBITDA" xlink:label="trex_EBITDA"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CapitalExpenditure" xlink:label="trex_CapitalExpenditure"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets" xlink:label="us-gaap_Assets"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ConsolidationItemsDomain" xlink:to="us-gaap_OperatingSegmentsMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingAbstract" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="srt_ConsolidationItemsAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_CostOfGoodsAndServicesSold" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_SegmentReportingInformationLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedTerseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_DepreciationDepletionAndAmortization" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_InterestIncomeOperating" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_InterestExpenseOperating" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_NetIncomeLoss" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_EBITDA" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_CapitalExpenditure" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_Assets" order="11" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/verboseLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesAdditionalInformationDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductOrServiceAxis" xlink:label="srt_ProductOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:label="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingAndTranscendCladdingMember" xlink:label="trex_SignatureRailingAndTranscendCladdingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsByNatureAxis" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInSecondYear" xlink:label="us-gaap_PurchaseObligationDueInSecondYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationByTypeAxis" xlink:label="us-gaap_ContingentConsiderationByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialUseMember" xlink:label="trex_ResidentialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RawMaterialSupplyContractsMember" xlink:label="trex_RawMaterialSupplyContractsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentAxis" xlink:label="us-gaap_SupplyCommitmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentArrangementMember" xlink:label="us-gaap_SupplyCommitmentArrangementMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingWarrantyReserveMember" xlink:label="trex_SurfaceFlakingWarrantyReserveMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_IndustrialRevenueBondsMember" xlink:label="trex_IndustrialRevenueBondsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TranscendDeckingMember" xlink:label="trex_TranscendDeckingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInThirdYear" xlink:label="us-gaap_PurchaseObligationDueInThirdYear"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CommercialUseMember" xlink:label="trex_CommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SelectDeckingAndUniversalFasciaMember" xlink:label="trex_SelectDeckingAndUniversalFasciaMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInFourthYear" xlink:label="us-gaap_PurchaseObligationDueInFourthYear"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialAndCommercialUseMember" xlink:label="trex_ResidentialAndCommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_WarrantyPeriod" xlink:label="trex_WarrantyPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingMember" xlink:label="trex_SignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AreaOfLand" xlink:label="us-gaap_AreaOfLand"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandAndLandImprovements" xlink:label="us-gaap_LandAndLandImprovements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" xlink:label="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentCarryingAmount" xlink:label="us-gaap_DebtInstrumentCarryingAmount"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GrossAssetAndLiability" xlink:label="trex_GrossAssetAndLiability"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductsAndServicesDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingAndTranscendCladdingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsNatureDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInSecondYear" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:to="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialUseMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:to="trex_RawMaterialSupplyContractsMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SupplyCommitmentAxis" xlink:to="us-gaap_SupplyCommitmentArrangementMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SupplyCommitmentArrangementMember" xlink:to="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="trex_ScheduleOfCommitmentsAndContingenciesTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="trex_SurfaceFlakingWarrantyReserveMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_IndustrialRevenueBondsMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="srt_ProductOrServiceAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_TranscendDeckingMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInThirdYear" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_CommercialUseMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_SupplyCommitmentArrangementMember" xlink:to="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_GuaranteeObligationsByNatureAxis" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SelectDeckingAndUniversalFasciaMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInFourthYear" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialAndCommercialUseMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_WarrantyPeriod" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="srt_RangeAxis" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingMember" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" order="4" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_ContingentConsiderationByTypeAxis" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" order="5" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_SupplyCommitmentAxis" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_AreaOfLand" order="6" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_LandAndLandImprovements" order="7" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="trex_ScheduleOfCommitmentsAndContingenciesLineItems" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" order="8" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_DebtInstrumentCarryingAmount" order="9" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_GrossAssetAndLiability" order="10" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationByTypeAxis" xlink:label="us-gaap_ContingentConsiderationByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityLineItems" xlink:label="us-gaap_ProductWarrantyLiabilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrual" xlink:label="us-gaap_StandardProductWarrantyAccrual"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityTable" xlink:label="us-gaap_ProductWarrantyLiabilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:label="us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingWarrantyReserveMember" xlink:label="trex_SurfaceFlakingWarrantyReserveMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingMember" xlink:label="trex_SurfaceFlakingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" xlink:label="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_OtherResidentialMember" xlink:label="trex_OtherResidentialMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPayments" xlink:label="us-gaap_StandardProductWarrantyAccrualPayments"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductWarrantyMember" xlink:label="trex_ProductWarrantyMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrual" xlink:label="us-gaap_StandardProductWarrantyAccrual_3"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationTypeDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrual" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ContingentConsiderationByTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="us-gaap_ProductWarrantyLiabilityTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="trex_SurfaceFlakingWarrantyReserveMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_SurfaceFlakingMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_OtherResidentialMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrualPayments" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ProductWarrantyLiabilityLineItems" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_ProductWarrantyMember" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/label"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrual_3" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
        </link:presentationLink>
        <link:presentationLink xlink:role="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReservesDetail" xlink:title="presentationLink" xlink:type="extended">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesBalance" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsAbstract" xlink:label="srt_ValuationAndQualifyingAccountsAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WarrantyReservesMember" xlink:label="us-gaap_WarrantyReservesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:label="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:label="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDeductions" xlink:label="us-gaap_ValuationAllowancesAndReservesDeductions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesBalance" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance_3"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesBalance" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodStartLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsAbstract" xlink:to="srt_ValuationAndQualifyingAccountsDisclosureTable" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="us-gaap_WarrantyReservesMember" order="0" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:to="srt_ValuationAndQualifyingAccountsDisclosureLineItems" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" order="1" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesDeductions" order="2" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2009/role/negatedLabel"/>
          <link:presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesBalance_3" order="3" priority="2" use="optional" preferredLabel="http://www.xbrl.org/2003/role/periodEndLabel"/>
        </link:presentationLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfChangesInStockholdersEquity">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="us-gaap_StatementEquityComponentsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockMember" xlink:label="us-gaap_CommonStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesIssued" xlink:label="us-gaap_SharesIssued"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalMember" xlink:label="us-gaap_AdditionalPaidInCapitalMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsMember" xlink:label="us-gaap_RetainedEarningsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonMember" xlink:label="us-gaap_TreasuryStockCommonMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" xlink:label="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" xlink:label="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodValue" xlink:label="us-gaap_StockRepurchasedDuringPeriodValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockSharesAcquired" xlink:label="us-gaap_TreasuryStockSharesAcquired"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockholdersEquity" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_EquityComponentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_EquityComponentDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_CommonStockMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementEquityComponentsAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_SharesIssued" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_AdditionalPaidInCapitalMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_NetIncomeLoss" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_RetainedEarningsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensation" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_TreasuryStockCommonMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensation" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StockRepurchasedDuringPeriodValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_TreasuryStockSharesAcquired" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureCybersecurityRiskManagementStrategyAndGovernance">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:label="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedFlag" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" xlink:label="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskRoleOfManagementTextBlock" xlink:label="cyd_CybersecurityRiskRoleOfManagementTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" xlink:label="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" xlink:label="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" xlink:label="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" xlink:label="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.sec.gov/cyd/2024/cyd-2024.xsd#cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" xlink:label="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:to="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedFlag" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingBoardCommitteeOrSubcommitteeResponsibleForOversightTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" xlink:to="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementStrategyAndGovernanceAbstract" xlink:to="cyd_CybersecurityRiskManagementStrategyAndGovernanceLineItems" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementProcessesIntegratedTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskRoleOfManagementTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskManagementThirdPartyEngagedFlag" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleFlag" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskThirdPartyOversightAndIdentificationProcessesFlag" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantFlag" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementExpertiseOfManagementResponsibleTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskManagementProcessesForAssessingIdentifyingAndManagingThreatsTextBlock" xlink:to="cyd_CybersecurityRiskMateriallyAffectedOrReasonablyLikelyToMateriallyAffectRegistrantTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskProcessForInformingManagementOrCommitteesResponsibleTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="cyd_CybersecurityRiskBoardOfDirectorsOversightTextBlock" xlink:to="cyd_CybersecurityRiskManagementPositionsOrCommitteesResponsibleReportToBoardFlag" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsInc">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" xlink:label="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TrexCommercialProductsIncMember" xlink:label="trex_TrexCommercialProductsIncMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain_default"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_RelatedPartyDomain" xlink:to="trex_TrexCommercialProductsIncMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyDomain_default" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationTables">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" xlink:label="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:label="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" xlink:label="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfCompensationCostForShareBasedPaymentArrangementsAllocationOfShareBasedCompensationCostsByPlanTableTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_ScheduleOfShareBasedCompensationStockAppreciationRightsAwardActivityTableTextBlock" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:label="trex_ScheduleOfSignificantAccountingPoliciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccountingPoliciesTable" xlink:label="trex_AccountingPoliciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductOrServiceAxis" xlink:label="srt_ProductOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:label="us-gaap_ConcentrationRiskByBenchmarkAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="us-gaap_ConcentrationRiskBenchmarkDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="us-gaap_ConcentrationRiskTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CustomerConcentrationRiskMember" xlink:label="us-gaap_CustomerConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MajorCustomersAxis" xlink:label="srt_MajorCustomersAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_NameOfMajorCustomerDomain" xlink:label="srt_NameOfMajorCustomerDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_NameOfMajorCustomerDomain" xlink:label="srt_NameOfMajorCustomerDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingMember" xlink:label="trex_SignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsByNatureAxis" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="us-gaap_SubsequentEventTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerOneMember" xlink:label="trex_CustomerOneMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_MaturityPeriodOfCashEquivalent" xlink:label="trex_MaturityPeriodOfCashEquivalent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingencyNatureDomain" xlink:label="us-gaap_GainContingencyNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InsuranceSettlementMember" xlink:label="us-gaap_InsuranceSettlementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemDomain" xlink:label="us-gaap_UnusualOrInfrequentItemDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FireAtVirginiaFacilityMember" xlink:label="trex_FireAtVirginiaFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="us-gaap_TypeOfAdoptionMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="us-gaap_TypeOfAdoptionMember_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LeaseholdImprovementsMember" xlink:label="us-gaap_LeaseholdImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CommercialUseMember" xlink:label="trex_CommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:label="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskByTypeAxis" xlink:label="us-gaap_ConcentrationRiskByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="us-gaap_ConcentrationRiskTypeDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_EquityMethodInvesteeNameDomain" xlink:label="srt_EquityMethodInvesteeNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_EquityMethodInvesteeNameDomain" xlink:label="srt_EquityMethodInvesteeNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitAxis" xlink:label="us-gaap_ReportingUnitAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:label="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RailingMember" xlink:label="trex_RailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SalesRevenueNetMember" xlink:label="us-gaap_SalesRevenueNetMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FourLargestSuppliersMember" xlink:label="trex_FourLargestSuppliersMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemAxis" xlink:label="us-gaap_UnusualOrInfrequentItemAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnusualOrInfrequentItemDomain" xlink:label="us-gaap_UnusualOrInfrequentItemDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingenciesByNatureAxis" xlink:label="us-gaap_GainContingenciesByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainContingencyNatureDomain" xlink:label="us-gaap_GainContingencyNatureDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplierConcentrationRiskMember" xlink:label="us-gaap_SupplierConcentrationRiskMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TranscendDeckingMember" xlink:label="trex_TranscendDeckingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerTwoMember" xlink:label="trex_CustomerTwoMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfFinancialInstitutionWithDeposit" xlink:label="trex_NumberOfFinancialInstitutionWithDeposit"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialUseMember" xlink:label="trex_ResidentialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StagingMember" xlink:label="trex_StagingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableMember" xlink:label="us-gaap_AccountsReceivableMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SelectDeckingAndUniversalFasciaMember" xlink:label="trex_SelectDeckingAndUniversalFasciaMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CustomerThreeMember" xlink:label="trex_CustomerThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" xlink:label="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PublicUtilitiesInventoryRawMaterialsMember" xlink:label="us-gaap_PublicUtilitiesInventoryRawMaterialsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConcentrationRiskPercentage1" xlink:label="us-gaap_ConcentrationRiskPercentage1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingAndTranscendCladdingMember" xlink:label="trex_SignatureRailingAndTranscendCladdingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" xlink:label="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfLargestRawMaterialSuppliers" xlink:label="trex_NumberOfLargestRawMaterialSuppliers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryLIFOReserve" xlink:label="us-gaap_InventoryLIFOReserve"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="us-gaap_GoodwillImpairmentLoss"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_WarrantyPeriod" xlink:label="trex_WarrantyPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResearchAndDevelopmentExpense" xlink:label="us-gaap_ResearchAndDevelopmentExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidAdvertising" xlink:label="us-gaap_PrepaidAdvertising"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdvertisingExpense" xlink:label="us-gaap_AdvertisingExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LessorOperatingLeaseTermOfContract" xlink:label="us-gaap_LessorOperatingLeaseTermOfContract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DescriptionOfOperatingLeasesWithInitialTerm" xlink:label="trex_DescriptionOfOperatingLeasesWithInitialTerm"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GainLossOnInsuranceSettlement" xlink:label="trex_GainLossOnInsuranceSettlement"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_AccountingPoliciesTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductsAndServicesDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductsAndServicesDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:to="us-gaap_ConcentrationRiskBenchmarkDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:to="us-gaap_ConcentrationRiskBenchmarkDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ConcentrationRiskTypeDomain" xlink:to="us-gaap_CustomerConcentrationRiskMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_MajorCustomersAxis" xlink:to="srt_NameOfMajorCustomerDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_MajorCustomersAxis" xlink:to="srt_NameOfMajorCustomerDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsNatureDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsNatureDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerOneMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_MaturityPeriodOfCashEquivalent" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GainContingencyNatureDomain" xlink:to="us-gaap_InsuranceSettlementMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_UnusualOrInfrequentItemDomain" xlink:to="trex_FireAtVirginiaFacilityMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:to="us-gaap_TypeOfAdoptionMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:to="us-gaap_TypeOfAdoptionMember_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_LeaseholdImprovementsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_CommercialUseMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ConcentrationRiskByTypeAxis" xlink:to="us-gaap_ConcentrationRiskTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ConcentrationRiskByTypeAxis" xlink:to="us-gaap_ConcentrationRiskTypeDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:to="srt_EquityMethodInvesteeNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis" xlink:to="srt_EquityMethodInvesteeNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_RailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_SalesRevenueNetMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionSupplierDomain" xlink:to="trex_FourLargestSuppliersMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_UnusualOrInfrequentItemAxis" xlink:to="us-gaap_UnusualOrInfrequentItemDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_UnusualOrInfrequentItemAxis" xlink:to="us-gaap_UnusualOrInfrequentItemDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_GainContingenciesByNatureAxis" xlink:to="us-gaap_GainContingencyNatureDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_GainContingenciesByNatureAxis" xlink:to="us-gaap_GainContingencyNatureDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ConcentrationRiskTypeDomain" xlink:to="us-gaap_SupplierConcentrationRiskMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_TranscendDeckingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerTwoMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfFinancialInstitutionWithDeposit" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialUseMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ConcentrationRiskByBenchmarkAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_StagingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_AccountsReceivableMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SelectDeckingAndUniversalFasciaMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_NameOfMajorCustomerDomain" xlink:to="trex_CustomerThreeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ConcentrationRiskByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="us-gaap_PublicUtilitiesInventoryRawMaterialsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_ConcentrationRiskPercentage1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_MajorCustomersAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingAndTranscendCladdingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_GuaranteeObligationsByNatureAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_NumberOfLargestRawMaterialSuppliers" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="srt_ProductOrServiceAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_InventoryLIFOReserve" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_GoodwillImpairmentLoss" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_WarrantyPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ReportingUnitAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_UnusualOrInfrequentItemAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="11" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_ResearchAndDevelopmentExpense" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="11" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_GainContingenciesByNatureAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="12" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_PrepaidAdvertising" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="12" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_ShareBasedGoodsAndNonemployeeServicesTransactionBySupplierAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="13" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_AdvertisingExpense" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="13" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_SubsequentEventTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="14" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_LessorOperatingLeaseTermOfContract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="14" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_AccountingPoliciesTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="15" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_DescriptionOfOperatingLeasesWithInitialTerm" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="16" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="trex_GainLossOnInsuranceSettlement" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="17" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfSignificantAccountingPoliciesLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentUsefulLife" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SummaryOfSignificantAccountingPoliciesEstimatedUsefulLivesOfPropertyPlantAndEquipmentDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingMember" xlink:label="us-gaap_BuildingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="us-gaap_MachineryAndEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FurnitureAndFixturesMember" xlink:label="us-gaap_FurnitureAndFixturesMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ForkliftsAndTractorsMember" xlink:label="trex_ForkliftsAndTractorsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComputerEquipmentMember" xlink:label="us-gaap_ComputerEquipmentMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentUsefulLife" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_BuildingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_MachineryAndEquipmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_FurnitureAndFixturesMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="trex_ForkliftsAndTractorsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ComputerEquipmentMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SaleOfTrexCommercialProductsIncAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:label="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:label="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyDomain" xlink:label="us-gaap_RelatedPartyDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TrexCommercialProductsIncMember" xlink:label="trex_TrexCommercialProductsIncMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:label="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_RelatedPartyDomain" xlink:to="trex_TrexCommercialProductsIncMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSubsidiaryOrEquityMethodInvesteeTable" xlink:to="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_RelatedPartyTransactionsByRelatedPartyAxis" xlink:to="us-gaap_RelatedPartyDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SubsidiaryOrEquityMethodInvesteeLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/GoodwillAndOtherIntangibleAssetsNetAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillLineItems" xlink:label="us-gaap_GoodwillLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfGoodwillTable" xlink:label="us-gaap_ScheduleOfGoodwillTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternetDomainNamesMember" xlink:label="us-gaap_InternetDomainNamesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Goodwill" xlink:label="us-gaap_Goodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitAxis" xlink:label="us-gaap_ReportingUnitAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ReportingUnitDomain" xlink:label="us-gaap_ReportingUnitDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RailingMember" xlink:label="trex_RailingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SoftwareDevelopmentMember" xlink:label="us-gaap_SoftwareDevelopmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:label="us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StagingMember" xlink:label="trex_StagingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DomainNamesAndInternalUseSoftwareMember" xlink:label="trex_DomainNamesAndInternalUseSoftwareMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AmortizationOfIntangibleAssets" xlink:label="us-gaap_AmortizationOfIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsGrossExcludingGoodwill" xlink:label="us-gaap_IntangibleAssetsGrossExcludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GoodwillImpairmentLoss" xlink:label="us-gaap_GoodwillImpairmentLoss"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_ScheduleOfGoodwillTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_InternetDomainNamesMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_Goodwill" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ReportingUnitAxis" xlink:to="us-gaap_ReportingUnitDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_RailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="us-gaap_SoftwareDevelopmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_FiniteLivedIntangibleAssetUsefulLife" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ReportingUnitDomain" xlink:to="trex_StagingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="trex_DomainNamesAndInternalUseSoftwareMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_AmortizationOfIntangibleAssets" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfGoodwillTable" xlink:to="us-gaap_ReportingUnitAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_IntangibleAssetsGrossExcludingGoodwill" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GoodwillLineItems" xlink:to="us-gaap_GoodwillImpairmentLoss" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_MachineryAndEquipmentMember" xlink:label="us-gaap_MachineryAndEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BuildingAndBuildingImprovementsMember" xlink:label="us-gaap_BuildingAndBuildingImprovementsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ForkliftsAndTractorsMember" xlink:label="trex_ForkliftsAndTractorsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComputerEquipmentMember" xlink:label="us-gaap_ComputerEquipmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FurnitureAndFixturesMember" xlink:label="us-gaap_FurnitureAndFixturesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConstructionInProgressMember" xlink:label="us-gaap_ConstructionInProgressMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandMember" xlink:label="us-gaap_LandMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_MachineryAndEquipmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_BuildingAndBuildingImprovementsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentNet" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="trex_ForkliftsAndTractorsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ComputerEquipmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_FurnitureAndFixturesMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ConstructionInProgressMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_LandMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="us-gaap_PropertyPlantAndEquipmentLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ConstructionInProgressMember" xlink:label="us-gaap_ConstructionInProgressMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Depreciation" xlink:label="us-gaap_Depreciation"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="us-gaap_PropertyPlantAndEquipmentTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="us-gaap_PropertyPlantAndEquipmentByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="us-gaap_ConstructionInProgressMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="us-gaap_Depreciation" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DebtAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLineItems" xlink:label="us-gaap_LineOfCreditFacilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityTable" xlink:label="us-gaap_LineOfCreditFacilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentAxis" xlink:label="us-gaap_DebtInstrumentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="us-gaap_DebtInstrumentNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="us-gaap_DebtInstrumentNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityAxis" xlink:label="us-gaap_LineOfCreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="us-gaap_LineOfCreditFacilityLenderDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityLenderDomain" xlink:label="us-gaap_LineOfCreditFacilityLenderDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateDomain" xlink:label="us-gaap_VariableRateDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BaseRateMember" xlink:label="us-gaap_BaseRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneAxis" xlink:label="trex_CreditFacilityOneAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneDomain" xlink:label="trex_CreditFacilityOneDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditFacilityOneDomain" xlink:label="trex_CreditFacilityOneDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityDomain" xlink:label="us-gaap_CreditFacilityDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="us-gaap_RevolvingCreditFacilityMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateAxis" xlink:label="us-gaap_VariableRateAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VariableRateDomain" xlink:label="us-gaap_VariableRateDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementDomain" xlink:label="trex_AgreementDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_FifthAmendmentAndRestatedAgreementMember" xlink:label="trex_FifthAmendmentAndRestatedAgreementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LetterOfCreditMember" xlink:label="us-gaap_LetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityAxis" xlink:label="us-gaap_CreditFacilityAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CreditFacilityDomain" xlink:label="us-gaap_CreditFacilityDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementAxis" xlink:label="trex_AgreementAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AgreementDomain" xlink:label="trex_AgreementDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" xlink:label="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingBLoanMember" xlink:label="trex_RevolvingBLoanMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CreditAgreementSecondAmendmentMember" xlink:label="trex_CreditAgreementSecondAmendmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SwinglineLetterOfCreditMember" xlink:label="trex_SwinglineLetterOfCreditMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCreditFacilityExpirationDate1" xlink:label="us-gaap_LineOfCreditFacilityExpirationDate1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RevolvingALoansMember" xlink:label="trex_RevolvingALoansMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentMaturityDate" xlink:label="us-gaap_DebtInstrumentMaturityDate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:label="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LinesOfCreditCurrent" xlink:label="us-gaap_LinesOfCreditCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LineOfCreditFacilityAdditionalBorrowingCapacity" xlink:label="trex_LineOfCreditFacilityAdditionalBorrowingCapacity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" xlink:label="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LineOfCredit" xlink:label="us-gaap_LineOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage" xlink:label="us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtWeightedAverageInterestRate" xlink:label="us-gaap_DebtWeightedAverageInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" xlink:label="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_DebtInstrumentAxis" xlink:to="us-gaap_DebtInstrumentNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_DebtInstrumentAxis" xlink:to="us-gaap_DebtInstrumentNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_LineOfCreditFacilityAxis" xlink:to="us-gaap_LineOfCreditFacilityLenderDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_LineOfCreditFacilityAxis" xlink:to="us-gaap_LineOfCreditFacilityLenderDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_VariableRateDomain" xlink:to="us-gaap_BaseRateMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="trex_CreditFacilityOneAxis" xlink:to="trex_CreditFacilityOneDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="trex_CreditFacilityOneAxis" xlink:to="trex_CreditFacilityOneDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityRemainingBorrowingCapacity" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="us-gaap_RevolvingCreditFacilityMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_VariableRateAxis" xlink:to="us-gaap_VariableRateDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_VariableRateAxis" xlink:to="us-gaap_VariableRateDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_AgreementDomain" xlink:to="trex_FifthAmendmentAndRestatedAgreementMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_CreditFacilityOneDomain" xlink:to="us-gaap_LetterOfCreditMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_CreditFacilityAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_CreditFacilityAxis" xlink:to="us-gaap_CreditFacilityDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_CreditFacilityAxis" xlink:to="us-gaap_CreditFacilityDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="trex_AgreementAxis" xlink:to="trex_AgreementDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="trex_AgreementAxis" xlink:to="trex_AgreementDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_VariableRateDomain" xlink:to="us-gaap_SecuredOvernightFinancingRateSofrOvernightIndexSwapRateMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="trex_RevolvingBLoanMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_AgreementDomain" xlink:to="trex_CreditAgreementSecondAmendmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_CreditFacilityOneDomain" xlink:to="trex_SwinglineLetterOfCreditMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_DebtInstrumentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCreditFacilityExpirationDate1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_CreditFacilityDomain" xlink:to="trex_RevolvingALoansMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_VariableRateAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentMaturityDate" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="us-gaap_LineOfCreditFacilityAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="trex_AgreementAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LinesOfCreditCurrent" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="trex_CreditFacilityOneAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="trex_LineOfCreditFacilityAdditionalBorrowingCapacity" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_LineOfCreditFacilityTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentDescriptionOfVariableRateBasis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_LineOfCredit" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtInstrumentInterestRateStatedPercentage" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="us-gaap_DebtWeightedAverageInterestRate" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="11" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LineOfCreditFacilityLineItems" xlink:to="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:label="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseCost" xlink:label="us-gaap_OperatingLeaseCost"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:label="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseCost" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:label="us-gaap_CashFlowOperatingActivitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:label="us-gaap_AssetsAndLiabilitiesLesseeAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeasePayments" xlink:label="us-gaap_OperatingLeasePayments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SupplementalBalanceSheetInformationAbstract" xlink:label="trex_SupplementalBalanceSheetInformationAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" xlink:label="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:to="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:to="us-gaap_OperatingLeasePayments" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_SupplementalBalanceSheetInformationAbstract" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="trex_SupplementalBalanceSheetInformationAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_AssetsAndLiabilitiesLesseeAbstract" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_CashFlowOperatingActivitiesLesseeAbstract" xlink:to="us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_AssetsAndLiabilitiesLesseeAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseLiability" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementLineItems" xlink:label="us-gaap_StatementLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementTable" xlink:label="us-gaap_StatementTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:label="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="us-gaap_StatementClassOfStockAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfStockDomain" xlink:label="us-gaap_ClassOfStockDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_StatementTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_StatementLineItems" xlink:to="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_StatementClassOfStockAxis" xlink:to="us-gaap_ClassOfStockDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_StatementTable" xlink:to="us-gaap_StatementClassOfStockAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_OperatingLeaseLiabilitiesPaymentsDueAbstract" xlink:to="us-gaap_OperatingLeaseLiability" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityClassOfTreasuryStockLineItems" xlink:label="us-gaap_EquityClassOfTreasuryStockLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ClassOfTreasuryStockTable" xlink:label="us-gaap_ClassOfTreasuryStockTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramAxis" xlink:label="srt_ShareRepurchaseProgramAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" xlink:label="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="us-gaap_StatementEquityComponentsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EquityComponentDomain" xlink:label="us-gaap_EquityComponentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockMember" xlink:label="us-gaap_CommonStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramDomain" xlink:label="srt_ShareRepurchaseProgramDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ShareRepurchaseProgramDomain" xlink:label="srt_ShareRepurchaseProgramDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockRepurchaseProgramMember" xlink:label="trex_StockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockSharesAcquired" xlink:label="us-gaap_TreasuryStockSharesAcquired"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandEighteenStockRepurchaseProgramMember" xlink:label="trex_TwoThousandEighteenStockRepurchaseProgramMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockRepurchasedDuringPeriodShares" xlink:label="us-gaap_StockRepurchasedDuringPeriodShares"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" xlink:label="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_ClassOfTreasuryStockTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="srt_ShareRepurchaseProgramAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="srt_StockRepurchaseProgramNumberOfSharesAuthorizedToBeRepurchased" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_StatementEquityComponentsAxis" xlink:to="us-gaap_EquityComponentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityComponentDomain" xlink:to="us-gaap_CommonStockMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ShareRepurchaseProgramAxis" xlink:to="srt_ShareRepurchaseProgramDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_ShareRepurchaseProgramAxis" xlink:to="srt_ShareRepurchaseProgramDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_StockRepurchaseProgramMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ClassOfTreasuryStockTable" xlink:to="us-gaap_StatementEquityComponentsAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_TreasuryStockSharesAcquired" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_TwoThousandEighteenStockRepurchaseProgramMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_EquityClassOfTreasuryStockLineItems" xlink:to="us-gaap_StockRepurchasedDuringPeriodShares" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ShareRepurchaseProgramDomain" xlink:to="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityComputationOfBasicAndDilutedEarningsPerShareDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:label="trex_ComponentsOfBasicAndDilutedEarningPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:label="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" xlink:label="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockAppreciationRightsMember" xlink:label="trex_StockAppreciationRightsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLossAbstract" xlink:label="us-gaap_NetIncomeLossAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:label="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:label="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RestrictedStockMember" xlink:label="us-gaap_RestrictedStockMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareBasic" xlink:label="us-gaap_EarningsPerShareBasic"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarningsPerShareDiluted" xlink:label="us-gaap_EarningsPerShareDiluted"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:to="us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_StockAppreciationRightsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_NetIncomeLossAbstract" xlink:to="us-gaap_NetIncomeLoss" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_NetIncomeLossAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" xlink:to="us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_RestrictedStockMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_WeightedAverageNumberOfSharesOutstandingBasicAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustmentAbstract" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_EarningsPerShareBasic" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" xlink:to="us-gaap_EarningsPerShareDiluted" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockholdersEquityAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:label="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesNameDomain" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesNameDomain" xlink:label="us-gaap_AntidilutiveSecuritiesNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:label="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RestrictedStockMember" xlink:label="us-gaap_RestrictedStockMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:to="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:to="us-gaap_AntidilutiveSecuritiesNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:to="us-gaap_AntidilutiveSecuritiesNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:to="us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="us-gaap_RestrictedStockMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/RevenueFromContractsWithCustomersSummaryOfDisaggregatedNetSalesDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueLineItems" xlink:label="us-gaap_DisaggregationOfRevenueLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DisaggregationOfRevenueTable" xlink:label="us-gaap_DisaggregationOfRevenueTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:label="us-gaap_TimingOfTransferOfGoodOrServiceDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredAtPointInTimeMember" xlink:label="us-gaap_TransferredAtPointInTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TransferredOverTimeMember" xlink:label="us-gaap_TransferredOverTimeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_DisaggregationOfRevenueLineItems" xlink:to="us-gaap_DisaggregationOfRevenueTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceAxis" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:to="us-gaap_TransferredAtPointInTimeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_DisaggregationOfRevenueLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_TimingOfTransferOfGoodOrServiceDomain" xlink:to="us-gaap_TransferredOverTimeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_DisaggregationOfRevenueTable" xlink:to="us-gaap_TimingOfTransferOfGoodOrServiceAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TwoThousandFourteenStockIncentivePlanMember" xlink:label="trex_TwoThousandFourteenStockIncentivePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameAxis" xlink:label="us-gaap_PlanNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingAxis" xlink:label="us-gaap_VestingAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingDomain" xlink:label="us-gaap_VestingDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_VestingDomain" xlink:label="us-gaap_VestingDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:label="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EmployeeStockPurchasePlanMember" xlink:label="trex_EmployeeStockPurchasePlanMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" xlink:label="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_StockIssuedSharesEmployeeStockPurchasePlan" xlink:label="trex_StockIssuedSharesEmployeeStockPurchasePlan"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" xlink:label="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_PlanNameDomain" xlink:to="trex_TwoThousandFourteenStockIncentivePlanMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_VestingAxis" xlink:to="us-gaap_VestingDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_VestingAxis" xlink:to="us-gaap_VestingDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_VestingAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_PlanNameAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_EmployeeStockPurchasePlanMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedPaymentArrangementValuationTechniqueExtensibleEnumeration" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardPurchasePriceOfCommonStockPercent" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="trex_StockIssuedSharesEmployeeStockPurchasePlan" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="11" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardMaximumEmployeeSubscriptionRate" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="12" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_CommonStockCapitalSharesReservedForFutureIssuance" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfStockBasedCompensationExpensesDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AllocatedShareBasedCompensationExpense" xlink:label="us-gaap_AllocatedShareBasedCompensationExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EmployeeStockPurchasePlanMember" xlink:label="trex_EmployeeStockPurchasePlanMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="us-gaap_AllocatedShareBasedCompensationExpense" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_EmployeeStockPurchasePlanMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationTimebasedRestrictedStockUnitActivityDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityLineItems" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityTable" xlink:label="trex_ScheduleOfRestrictedStockActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TimeBasedRestrictedStockUnitsMember" xlink:label="trex_TimeBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="trex_ScheduleOfRestrictedStockActivityTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_TimeBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureStockbasedCompensationPerformancebasedRestrictedStockUnitActivityDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityLineItems" xlink:label="trex_ScheduleOfRestrictedStockActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfRestrictedStockActivityTable" xlink:label="trex_ScheduleOfRestrictedStockActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PerformanceBasedRestrictedStockUnitsMember" xlink:label="trex_PerformanceBasedRestrictedStockUnitsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="trex_ScheduleOfRestrictedStockActivityTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="trex_PerformanceBasedRestrictedStockUnitsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfRestrictedStockActivityTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfRestrictedStockActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSummaryOfAssumptionsUsedToEstimateFairValueOfEachSarDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/StockBasedCompensationSarActivityDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:label="trex_ScheduleOfStockAppreciationRightsActivityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockAppreciationRightsSARSMember" xlink:label="us-gaap_StockAppreciationRightsSARSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AwardTypeAxis" xlink:label="us-gaap_AwardTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" xlink:label="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" xlink:label="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" xlink:label="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" xlink:label="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" xlink:label="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ScheduleOfStockAppreciationRightsActivityTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingNumber" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="us-gaap_StockAppreciationRightsSARSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_AwardTypeAxis" xlink:to="us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityTable" xlink:to="us-gaap_AwardTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsGranted" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercised" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsForfeitures" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="12" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="13" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="14" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="15" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="16" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="17" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueOutstanding" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="18" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardEquityInstrumentsOtherThanOptionsAggregateIntrinsicValueVested" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="19" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfStockAppreciationRightsActivityLineItems" xlink:to="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/EmployeeBenefitPlansAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:label="us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:label="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameAxis" xlink:label="us-gaap_PlanNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PlanNameDomain" xlink:label="us-gaap_PlanNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeAxis" xlink:label="us-gaap_SubsequentEventTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SubsequentEventTypeDomain" xlink:label="us-gaap_SubsequentEventTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DefinedContributionPlanCostRecognized" xlink:label="us-gaap_DefinedContributionPlanCostRecognized"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:to="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_PlanNameAxis" xlink:to="us-gaap_PlanNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_PlanNameAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_SubsequentEventTypeAxis" xlink:to="us-gaap_SubsequentEventTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_DefinedBenefitPlanDisclosureLineItems" xlink:to="us-gaap_DefinedContributionPlanCostRecognized" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable" xlink:to="us-gaap_SubsequentEventTypeAxis" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyLineItems" xlink:label="us-gaap_IncomeTaxContingencyLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxContingencyTable" xlink:label="us-gaap_IncomeTaxContingencyTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="us-gaap_IncomeTaxAuthorityNameDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InternalRevenueServiceIRSMember" xlink:label="us-gaap_InternalRevenueServiceIRSMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodAxis" xlink:label="us-gaap_TaxPeriodAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodDomain" xlink:label="us-gaap_TaxPeriodDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EarliestTaxYearMember" xlink:label="us-gaap_EarliestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TaxPeriodDomain" xlink:label="us-gaap_TaxPeriodDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameAxis" xlink:label="us-gaap_IncomeTaxAuthorityNameAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="us-gaap_IncomeTaxAuthorityNameDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LatestTaxYearMember" xlink:label="us-gaap_LatestTaxYearMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_UnrecognizedTaxBenefits" xlink:label="us-gaap_UnrecognizedTaxBenefits"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" xlink:label="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OpenTaxYear" xlink:label="us-gaap_OpenTaxYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_IncomeTaxContingencyTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxAuthorityNameDomain" xlink:to="us-gaap_InternalRevenueServiceIRSMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_TaxPeriodAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_TaxPeriodDomain" xlink:to="us-gaap_EarliestTaxYearMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_TaxPeriodAxis" xlink:to="us-gaap_TaxPeriodDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_TaxPeriodAxis" xlink:to="us-gaap_TaxPeriodDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_IncomeTaxAuthorityNameAxis" xlink:to="us-gaap_IncomeTaxAuthorityNameDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_IncomeTaxAuthorityNameAxis" xlink:to="us-gaap_IncomeTaxAuthorityNameDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_IncomeTaxExpenseBenefit" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_IncomeTaxContingencyTable" xlink:to="us-gaap_IncomeTaxAuthorityNameAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_TaxPeriodDomain" xlink:to="us-gaap_LatestTaxYearMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_UnrecognizedTaxBenefits" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_OpenTaxYear" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_IncomeTaxContingencyLineItems" xlink:to="us-gaap_EffectiveIncomeTaxRateContinuingOperations" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformationAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="us-gaap_SegmentReportingInformationLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntersegmentEliminationMember" xlink:label="us-gaap_IntersegmentEliminationMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsAxis" xlink:label="srt_ConsolidationItemsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NumberOfReportableSegments" xlink:label="us-gaap_NumberOfReportableSegments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_NumberOfSalesRetailers" xlink:label="trex_NumberOfSalesRetailers"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" xlink:label="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" xlink:label="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnDispositionOfAssets1" xlink:label="us-gaap_GainLossOnDispositionOfAssets1"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ConsolidationItemsDomain" xlink:to="us-gaap_IntersegmentEliminationMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_NumberOfReportableSegments" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="srt_ConsolidationItemsAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_NumberOfSalesRetailers" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SegmentReportingCodmIndividualTitleAndPositionOrGroupOrCommitteeNameExtensibleEnumeration" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SegmentReportingCodmProfitLossMeasureHowUsedDescription" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainLossOnDispositionOfAssets1" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/SegmentInformationDetailsOfSegmentInformationDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SegmentReportingInformationLineItems" xlink:label="us-gaap_SegmentReportingInformationLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:label="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsDomain" xlink:label="srt_ConsolidationItemsDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingSegmentsMember" xlink:label="us-gaap_OperatingSegmentsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ConsolidationItemsAxis" xlink:label="srt_ConsolidationItemsAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommercialPortfolioSegmentMember" xlink:label="us-gaap_CommercialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostOfGoodsAndServicesSold" xlink:label="us-gaap_CostOfGoodsAndServicesSold"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="us-gaap_DepreciationDepletionAndAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeOperating" xlink:label="us-gaap_InterestIncomeOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestExpenseOperating" xlink:label="us-gaap_InterestExpenseOperating"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EBITDA" xlink:label="trex_EBITDA"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CapitalExpenditure" xlink:label="trex_CapitalExpenditure"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets" xlink:label="us-gaap_Assets"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ConsolidationItemsDomain" xlink:to="us-gaap_OperatingSegmentsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ConsolidationItemsAxis" xlink:to="srt_ConsolidationItemsDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="srt_ConsolidationItemsAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_CommercialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_CostOfGoodsAndServicesSold" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_DepreciationDepletionAndAmortization" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_InterestIncomeOperating" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_InterestExpenseOperating" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_IncomeTaxExpenseBenefit" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_NetIncomeLoss" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_EBITDA" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="trex_CapitalExpenditure" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="11" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SegmentReportingInformationLineItems" xlink:to="us-gaap_Assets" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/CommitmentsAndContingenciesAdditionalInformationDetail">
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesLineItems"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:label="trex_ScheduleOfCommitmentsAndContingenciesTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductOrServiceAxis" xlink:label="srt_ProductOrServiceAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ProductsAndServicesDomain" xlink:label="srt_ProductsAndServicesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:label="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingAndTranscendCladdingMember" xlink:label="trex_SignatureRailingAndTranscendCladdingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsByNatureAxis" xlink:label="us-gaap_GuaranteeObligationsByNatureAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GuaranteeObligationsNatureDomain" xlink:label="us-gaap_GuaranteeObligationsNatureDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeMember" xlink:label="srt_RangeMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MaximumMember" xlink:label="srt_MaximumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInSecondYear" xlink:label="us-gaap_PurchaseObligationDueInSecondYear"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ResidentialPortfolioSegmentMember" xlink:label="us-gaap_ResidentialPortfolioSegmentMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationByTypeAxis" xlink:label="us-gaap_ContingentConsiderationByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_RangeAxis" xlink:label="srt_RangeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:label="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain_default"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:label="us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialUseMember" xlink:label="trex_ResidentialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_RawMaterialSupplyContractsMember" xlink:label="trex_RawMaterialSupplyContractsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentAxis" xlink:label="us-gaap_SupplyCommitmentAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentArrangementMember" xlink:label="us-gaap_SupplyCommitmentArrangementMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SupplyCommitmentArrangementMember" xlink:label="us-gaap_SupplyCommitmentArrangementMember_default"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingWarrantyReserveMember" xlink:label="trex_SurfaceFlakingWarrantyReserveMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_IndustrialRevenueBondsMember" xlink:label="trex_IndustrialRevenueBondsMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_TranscendDeckingMember" xlink:label="trex_TranscendDeckingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_MinimumMember" xlink:label="srt_MinimumMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInThirdYear" xlink:label="us-gaap_PurchaseObligationDueInThirdYear"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_CommercialUseMember" xlink:label="trex_CommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" xlink:label="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SelectDeckingAndUniversalFasciaMember" xlink:label="trex_SelectDeckingAndUniversalFasciaMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PurchaseObligationDueInFourthYear" xlink:label="us-gaap_PurchaseObligationDueInFourthYear"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ResidentialAndCommercialUseMember" xlink:label="trex_ResidentialAndCommercialUseMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" xlink:label="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_WarrantyPeriod" xlink:label="trex_WarrantyPeriod"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SignatureRailingMember" xlink:label="trex_SignatureRailingMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" xlink:label="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" xlink:label="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AreaOfLand" xlink:label="us-gaap_AreaOfLand"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LandAndLandImprovements" xlink:label="us-gaap_LandAndLandImprovements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" xlink:label="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtInstrumentCarryingAmount" xlink:label="us-gaap_DebtInstrumentCarryingAmount"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_GrossAssetAndLiability" xlink:label="trex_GrossAssetAndLiability"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_ScheduleOfCommitmentsAndContingenciesTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_ProductOrServiceAxis" xlink:to="srt_ProductsAndServicesDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingAndTranscendCladdingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_GuaranteeObligationsByNatureAxis" xlink:to="us-gaap_GuaranteeObligationsNatureDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MaximumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInSecondYear" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentDomain" xlink:to="us-gaap_ResidentialPortfolioSegmentMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationTypeDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="srt_RangeAxis" xlink:to="srt_RangeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:to="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_LongTermPurchaseCommitmentByCategoryOfItemPurchasedAxis" xlink:to="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_FinancingReceivablePortfolioSegmentAxis" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialUseMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LongTermPurchaseCommitmentCategoryOfItemPurchasedDomain" xlink:to="trex_RawMaterialSupplyContractsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_SupplyCommitmentAxis" xlink:to="us-gaap_SupplyCommitmentArrangementMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="us-gaap_SupplyCommitmentAxis" xlink:to="us-gaap_SupplyCommitmentArrangementMember_default" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SupplyCommitmentArrangementMember" xlink:to="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="trex_SurfaceFlakingWarrantyReserveMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_IndustrialRevenueBondsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="srt_ProductOrServiceAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_TranscendDeckingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_RangeMember" xlink:to="srt_MinimumMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInThirdYear" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_CommercialUseMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_SupplyCommitmentArrangementMember" xlink:to="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_GuaranteeObligationsByNatureAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SelectDeckingAndUniversalFasciaMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_PurchaseObligationDueInFourthYear" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_GuaranteeObligationsNatureDomain" xlink:to="trex_ResidentialAndCommercialUseMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="3" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_WarrantyPeriod" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="srt_RangeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ProductsAndServicesDomain" xlink:to="trex_SignatureRailingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="4" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_ContingentConsiderationByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="5" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_SupplyCommitmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="6" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_AreaOfLand" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesTable" xlink:to="us-gaap_FinancingReceivablePortfolioSegmentAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="7" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_LandAndLandImprovements" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="8" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_ProductWarrantyAccrualPeriodIncreaseDecrease" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="9" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="us-gaap_DebtInstrumentCarryingAmount" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="10" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="trex_ScheduleOfCommitmentsAndContingenciesLineItems" xlink:to="trex_GrossAssetAndLiability" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureCommitmentsAndContingenciesSummaryOfTrexResidentialProductWarrantyAndSurfaceFlakingReservesActivityDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityLineItems" xlink:label="us-gaap_ProductWarrantyLiabilityLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProductWarrantyLiabilityTable" xlink:label="us-gaap_ProductWarrantyLiabilityTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationByTypeAxis" xlink:label="us-gaap_ContingentConsiderationByTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ContingentConsiderationTypeDomain" xlink:label="us-gaap_ContingentConsiderationTypeDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrual" xlink:label="us-gaap_StandardProductWarrantyAccrual"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingWarrantyReserveMember" xlink:label="trex_SurfaceFlakingWarrantyReserveMember"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_SurfaceFlakingMember" xlink:label="trex_SurfaceFlakingMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" xlink:label="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_OtherResidentialMember" xlink:label="trex_OtherResidentialMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualPayments" xlink:label="us-gaap_StandardProductWarrantyAccrualPayments"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_ProductWarrantyMember" xlink:label="trex_ProductWarrantyMember"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_ProductWarrantyLiabilityTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ContingentConsiderationByTypeAxis" xlink:to="us-gaap_ContingentConsiderationTypeDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrual" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ContingentConsiderationByTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="trex_SurfaceFlakingWarrantyReserveMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_SurfaceFlakingMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrualPreexistingIncreaseDecrease" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="us-gaap_ProductWarrantyLiabilityTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_OtherResidentialMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ProductWarrantyLiabilityLineItems" xlink:to="us-gaap_StandardProductWarrantyAccrualPayments" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ContingentConsiderationTypeDomain" xlink:to="trex_ProductWarrantyMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/ScheduleIiValuationAndQualifyingAccountsAndReservesDetail">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureLineItems"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:label="srt_ValuationAndQualifyingAccountsDisclosureTable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:label="us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesBalance" xlink:label="us-gaap_ValuationAllowancesAndReservesBalance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDomain" xlink:label="us-gaap_ValuationAllowancesAndReservesDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WarrantyReservesMember" xlink:label="us-gaap_WarrantyReservesMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:label="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:label="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationAllowancesAndReservesDeductions" xlink:label="us-gaap_ValuationAllowancesAndReservesDeductions"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="srt_ValuationAndQualifyingAccountsDisclosureTable" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:to="us-gaap_ValuationAllowancesAndReservesTypeAxis" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesBalance" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="us-gaap_ValuationAllowancesAndReservesDomain" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="us-gaap_WarrantyReservesMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="1" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" priority="2" use="optional"/>
          <link:definitionArc xlink:type="arc" order="2" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="us-gaap_ValuationAllowancesAndReservesDeductions" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrentAbstract" xlink:label="us-gaap_LiabilitiesCurrentAbstract"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ValuationTechniqueDomain" xlink:label="us-gaap_ValuationTechniqueDomain"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_BlackScholesMertonModelMember" xlink:label="us-gaap_BlackScholesMertonModelMember"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="us-gaap_LiabilitiesCurrentAbstract" xlink:to="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" priority="2" use="optional"/>
        </link:definitionLink>
        <link:definitionLink xlink:type="extended" xlink:role="http://fasb.org/srt/role/srt-eedm/ExtensibleEnumerationLists">
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/srt/2024/elts/srt-2024.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:label="srt_TitleOfIndividualWithRelationshipToEntityDomain"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PresidentAndChiefExecutiveOfficerMember" xlink:label="trex_PresidentAndChiefExecutiveOfficerMember"/>
          <link:definitionArc xlink:type="arc" order="0" xbrldt:closed="false" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:to="trex_PresidentAndChiefExecutiveOfficerMember" priority="2" use="optional"/>
        </link:definitionLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfComprehensiveIncome">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="us-gaap_InterestIncomeExpenseNet" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetIncomeLoss" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_ComprehensiveIncomeNetOfTax" xlink:to="us-gaap_NetIncomeLoss" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_GrossProfit" xlink:to="us-gaap_CostOfGoodsAndServicesSold" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="us-gaap_OperatingIncomeLoss" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetIncomeLoss" xlink:to="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_GrossProfit" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense" order="3" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_GrossProfit" order="4" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestIncomeExpenseNet" xlink:label="us-gaap_InterestIncomeExpenseNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss" xlink:label="us-gaap_NetIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GrossProfit" xlink:label="us-gaap_GrossProfit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostOfGoodsAndServicesSold" xlink:label="us-gaap_CostOfGoodsAndServicesSold"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingIncomeLoss" xlink:label="us-gaap_OperatingIncomeLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/DisclosureLeasesMaturitiesOfOperatingLeaseLiabilitiesDetail2">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_OperatingLeaseLiability" order="1" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedBalanceSheets">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_PropertyPlantAndEquipmentNet" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_TreasuryStockValue" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_StockholdersEquity" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_LiabilitiesCurrent" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_CashAndCashEquivalentsAtCarryingValue" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_LinesOfCreditCurrent" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_IntangibleAssetsNetIncludingGoodwill" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_RetainedEarningsAccumulatedDeficit" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_CommitmentsAndContingencies" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_AccountsReceivableNetCurrent" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_StandardProductWarrantyAccrualCurrent" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_OtherAssetsNoncurrent" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_AdditionalPaidInCapitalCommonStock" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_Liabilities" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_OtherLiabilitiesNoncurrent" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_CommonStockValue" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_StandardProductWarrantyAccrualNoncurrent" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_InventoryNet" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_AccountsPayableCurrent" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_AssetsCurrent" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_PreferredStockValue" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_DeferredIncomeTaxLiabilitiesNet" order="4" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets" xlink:label="us-gaap_Assets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity" xlink:label="us-gaap_StockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockValue" xlink:label="us-gaap_TreasuryStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Liabilities" xlink:label="us-gaap_Liabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesCurrent" xlink:label="us-gaap_LiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsCurrent" xlink:label="us-gaap_AssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:label="us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LinesOfCreditCurrent" xlink:label="us-gaap_LinesOfCreditCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:label="us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommitmentsAndContingencies" xlink:label="us-gaap_CommitmentsAndContingencies"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsReceivableNetCurrent" xlink:label="us-gaap_AccountsReceivableNetCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualCurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsNoncurrent" xlink:label="us-gaap_OtherAssetsNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AdditionalPaidInCapitalCommonStock" xlink:label="us-gaap_AdditionalPaidInCapitalCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherLiabilitiesNoncurrent" xlink:label="us-gaap_OtherLiabilitiesNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CommonStockValue" xlink:label="us-gaap_CommonStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StandardProductWarrantyAccrualNoncurrent" xlink:label="us-gaap_StandardProductWarrantyAccrualNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryNet" xlink:label="us-gaap_InventoryNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccountsPayableCurrent" xlink:label="us-gaap_AccountsPayableCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PreferredStockValue" xlink:label="us-gaap_PreferredStockValue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/ConsolidatedStatementsOfCashFlows">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_GainOrLossOnSaleOfStockInSubsidiary" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="trex_PaymentsForProceedsFromFinancingCosts" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivities" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_PaymentsToAcquireIntangibleAssets" order="1" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivities" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_ProfitLoss" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_PaymentsForRepurchaseOfCommonStock" order="2" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivities" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_RepaymentsOfLinesOfCredit" order="3" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_ProceedsFromLinesOfCredit" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccountsPayable" order="5" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" order="6" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInInventories" order="7" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccountsReceivable" order="8" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_OtherNoncashIncomeExpense" order="9" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_GainLossOnSaleOfPropertyPlantEquipment" order="10" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_ShareBasedCompensation" order="11" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit" order="12" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_DepreciationDepletionAndAmortization" order="13" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainOrLossOnSaleOfStockInSubsidiary" xlink:label="us-gaap_GainOrLossOnSaleOfStockInSubsidiary"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_PaymentsForProceedsFromFinancingCosts" xlink:label="trex_PaymentsForProceedsFromFinancingCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:label="us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsToAcquireIntangibleAssets" xlink:label="us-gaap_PaymentsToAcquireIntangibleAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProfitLoss" xlink:label="us-gaap_ProfitLoss"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates" xlink:label="us-gaap_ProceedsFromDivestitureOfInterestInSubsidiariesAndAffiliates"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable" xlink:label="us-gaap_IncreaseDecreaseInIncomeTaxesPayableNetOfIncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RepaymentsOfLinesOfCredit" xlink:label="us-gaap_RepaymentsOfLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilitiesAndOtherOperatingLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromLinesOfCredit" xlink:label="us-gaap_ProceedsFromLinesOfCredit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsPayable" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInInventories" xlink:label="us-gaap_IncreaseDecreaseInInventories"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:label="us-gaap_IncreaseDecreaseInAccountsReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherNoncashIncomeExpense" xlink:label="us-gaap_OtherNoncashIncomeExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:label="us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensation" xlink:label="us-gaap_ShareBasedCompensation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:label="us-gaap_DepreciationDepletionAndAmortization"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/InventoriesSummaryOfInventoriesDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_InventoryGross" xlink:to="us-gaap_InventoryFinishedGoods" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LIFOInventoryAmount" xlink:to="us-gaap_InventoryGross" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_InventoryGross" xlink:to="us-gaap_InventoryRawMaterials" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LIFOInventoryAmount" xlink:to="us-gaap_InventoryLIFOReserve" order="1" weight="-1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryGross" xlink:label="us-gaap_InventoryGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryFinishedGoods" xlink:label="us-gaap_InventoryFinishedGoods"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LIFOInventoryAmount" xlink:label="us-gaap_LIFOInventoryAmount"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryRawMaterials" xlink:label="us-gaap_InventoryRawMaterials"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InventoryLIFOReserve" xlink:label="us-gaap_InventoryLIFOReserve"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/PrepaidExpensesAndOtherAssetsSummaryOfPrepaidExpensesAndOtherAssetsDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:to="us-gaap_OtherAssetsCurrent" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:to="us-gaap_IncomeTaxesReceivable" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:to="us-gaap_PrepaidExpenseCurrent" order="2" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAssetsCurrent" xlink:label="us-gaap_OtherAssetsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxesReceivable" xlink:label="us-gaap_IncomeTaxesReceivable"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PrepaidExpenseCurrent" xlink:label="us-gaap_PrepaidExpenseCurrent"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_PropertyPlantAndEquipmentNet" xlink:to="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" order="0" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_PropertyPlantAndEquipmentNet" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" order="1" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="us-gaap_PropertyPlantAndEquipmentNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="us-gaap_PropertyPlantAndEquipmentGross"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/AccruedExpensesAndOtherLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="us-gaap_AccruedMarketingCostsCurrent" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="us-gaap_EmployeeRelatedLiabilitiesCurrent" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="trex_AccruedCapitalProjectsCurrent" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="trex_AccruedManufacturingExpensesCurrent" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="us-gaap_AccruedIncomeTaxesCurrent" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="us-gaap_OtherAccruedLiabilitiesCurrent" order="5" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:to="us-gaap_OperatingLeaseLiabilityCurrent" order="6" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" xlink:label="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedMarketingCostsCurrent" xlink:label="us-gaap_AccruedMarketingCostsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedCapitalProjectsCurrent" xlink:label="trex_AccruedCapitalProjectsCurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_AccruedManufacturingExpensesCurrent" xlink:label="trex_AccruedManufacturingExpensesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccruedIncomeTaxesCurrent" xlink:label="us-gaap_AccruedIncomeTaxesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherAccruedLiabilitiesCurrent" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityCurrent" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesSupplementalCashFlowInformationToOperatingLeasesDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_OperatingLeaseLiability" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_OperatingLeaseLiability" xlink:to="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" order="1" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiability" xlink:label="us-gaap_OperatingLeaseLiability"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" xlink:label="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/LeasesMaturitiesOfOperatingLeaseLiabilitiesDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" order="5" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesIncomeTaxProvisionBenefitDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentStateAndLocalTaxExpenseBenefit" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentFederalTaxExpenseBenefit" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefit" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredFederalIncomeTaxExpenseBenefit" order="1" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CurrentFederalTaxExpenseBenefit" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesReconciliationOfDifferencesBetweenIncomeTaxProvisionAndIncomeTaxDeterminedByApplyingUsFederalStatutoryRateDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationOtherAdjustments" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationTaxCredits" order="1" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationTaxSettlements" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationNondeductibleExpense" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" order="5" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="us-gaap_IncomeTaxExpenseBenefit"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationOtherAdjustments" xlink:label="us-gaap_IncomeTaxReconciliationOtherAdjustments"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxCredits" xlink:label="us-gaap_IncomeTaxReconciliationTaxCredits"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationTaxSettlements" xlink:label="us-gaap_IncomeTaxReconciliationTaxSettlements"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationNondeductibleExpense" xlink:label="us-gaap_IncomeTaxReconciliationNondeductibleExpense"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes" xlink:label="us-gaap_IncomeTaxReconciliationStateAndLocalIncomeTaxes"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate" xlink:label="us-gaap_IncomeTaxReconciliationIncomeTaxExpenseBenefitAtFederalStatutoryIncomeTaxRate"/>
        </link:calculationLink>
        <link:calculationLink xlink:type="extended" xlink:role="http://www.trex.com/20241231/taxonomy/role/IncomeTaxesScheduleOfDeferredTaxAssetsAndLiabilitiesDetail">
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:to="us-gaap_DeferredIncomeTaxLiabilities" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsNet" xlink:to="us-gaap_DeferredTaxAssetsGross" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsInventory" order="0" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:to="us-gaap_DeferredTaxAssetsNet" order="1" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsNet" xlink:to="us-gaap_DeferredTaxAssetsValuationAllowance" order="1" weight="-1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsOther" order="1" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="trex_DeferredTaxLiabilitiesInventoriesAndOther" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" order="2" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="trex_DeferredTaxLiabilitiesGoodwillAmortization" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" order="3" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="trex_DeferredTaxLiabilitiesDepreciation" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" order="4" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" order="5" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsDeferredIncome" order="6" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="trex_DeferredTaxAssetsOperatingLeaseLiabilities" order="7" weight="1" use="optional"/>
          <link:calculationArc xlink:type="arc" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" order="8" weight="1" use="optional"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilities" xlink:label="us-gaap_DeferredIncomeTaxLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts" xlink:label="us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedInventoryCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsNet" xlink:label="us-gaap_DeferredTaxAssetsNet"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsGross" xlink:label="us-gaap_DeferredTaxAssetsGross"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsInventory" xlink:label="us-gaap_DeferredTaxAssetsInventory"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" xlink:label="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="us-gaap_DeferredTaxAssetsValuationAllowance"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOther" xlink:label="us-gaap_DeferredTaxAssetsOther"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesInventoriesAndOther" xlink:label="trex_DeferredTaxLiabilitiesInventoriesAndOther"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesGoodwillAmortization" xlink:label="trex_DeferredTaxLiabilitiesGoodwillAmortization"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsWarrantyReserves"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxLiabilitiesDepreciation" xlink:label="trex_DeferredTaxLiabilitiesDepreciation"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" xlink:label="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsDeferredIncome" xlink:label="us-gaap_DeferredTaxAssetsDeferredIncome"/>
          <link:loc xlink:type="locator" xlink:href="trex-20241231.xsd#trex_DeferredTaxAssetsOperatingLeaseLiabilities" xlink:label="trex_DeferredTaxAssetsOperatingLeaseLiabilities"/>
          <link:loc xlink:type="locator" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwards" xlink:label="us-gaap_DeferredTaxAssetsTaxCreditCarryforwards"/>
        </link:calculationLink>
      </link:linkbase>
    </xsd:appinfo>
  </xsd:annotation>
  <xsd:element id="trex_NonRule10B51ArrModifiedFlag" name="NonRule10B51ArrModifiedFlag" type="xbrli:booleanItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_SwinglineLetterOfCreditMember" name="SwinglineLetterOfCreditMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_DeferredTaxLiabilitiesInventoriesAndOther" name="DeferredTaxLiabilitiesInventoriesAndOther" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_CapitalExpendituresInAccountsPayable" name="CapitalExpendituresInAccountsPayable" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_DomainNamesAndInternalUseSoftwareMember" name="DomainNamesAndInternalUseSoftwareMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_CustomerThreeMember" name="CustomerThreeMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_DeferredTaxLiabilitiesGoodwillAmortization" name="DeferredTaxLiabilitiesGoodwillAmortization" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_DescriptionOfOperatingLeasesWithInitialTerm" name="DescriptionOfOperatingLeasesWithInitialTerm" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_PercentSensitivityChangeInExpectedSurfaceFlakingClaims" name="PercentSensitivityChangeInExpectedSurfaceFlakingClaims" type="dtr-types:percentItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ComponentsOfBasicAndDilutedEarningPerShareLineItems" name="ComponentsOfBasicAndDilutedEarningPerShareLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_GainLossOnInsuranceSettlement" name="GainLossOnInsuranceSettlement" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" name="SharebasedCompensationArrangementByShareBasedPaymentAwardNonoptionEquityInstrumentsVested" type="xbrli:sharesItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsVestedWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false"/>
  <xsd:element id="trex_ForkliftsAndTractorsMember" name="ForkliftsAndTractorsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_CreditFacilityOneDomain" name="CreditFacilityOneDomain" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SelectDeckingAndUniversalFasciaMember" name="SelectDeckingAndUniversalFasciaMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" name="UnrecognizedTaxBenefitsNumberOfTaxMattersIdentified" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ResidentialAndCommercialUseMember" name="ResidentialAndCommercialUseMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_TwoThousandTwentyThreeStockRepurchaseProgramMember" name="TwoThousandTwentyThreeStockRepurchaseProgramMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_AccountingPoliciesTable" name="AccountingPoliciesTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_CustomerOneMember" name="CustomerOneMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_NumberOfSalesRetailers" name="NumberOfSalesRetailers" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_NumberOfLargestRawMaterialSuppliers" name="NumberOfLargestRawMaterialSuppliers" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionGrantsInPeriodWeightedAverageGrantDateFairValuePerPricingModel" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ScheduleOfRestrictedStockActivityLineItems" name="ScheduleOfRestrictedStockActivityLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_FourLargestSuppliersMember" name="FourLargestSuppliersMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" name="AccruedLiabilitiesAndOtherLiabilitiesCurrentExcludingWarranty" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_PaymentsForProceedsFromFinancingCosts" name="PaymentsForProceedsFromFinancingCosts" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" name="PerformanceBasedRestrictedStockAndPerformanceBasedRestrictedStockUnitsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_CreditFacilityOneAxis" name="CreditFacilityOneAxis" type="xbrli:stringItemType" substitutionGroup="xbrldt:dimensionItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" name="ScheduleOfReconciliationOfNetIncomeToEBITDATableTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_WarrantyPeriod" name="WarrantyPeriod" type="xbrli:durationItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_AccruedManufacturingExpensesCurrent" name="AccruedManufacturingExpensesCurrent" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_SeasonalityDisclosureTextBlock" name="SeasonalityDisclosureTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsExercisableIntrinsicValue" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="debit"/>
  <xsd:element id="trex_ScheduleOfCommitmentsAndContingenciesLineItems" name="ScheduleOfCommitmentsAndContingenciesLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_AgreementAxis" name="AgreementAxis" type="xbrli:stringItemType" substitutionGroup="xbrldt:dimensionItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" name="LesseeOperatingLeasesAccruedExpensesAndOtherCurrentLiabilities" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" name="NumberOfCustomerAccountedForTenPercentOrMoreSalesOfNetSales" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" name="ProductsSoldOnOrAfterJanuaryOneTwoThousandAndTwentyThreeMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_TwoThousandEighteenStockRepurchaseProgramMember" name="TwoThousandEighteenStockRepurchaseProgramMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SupplementalBalanceSheetInformationAbstract" name="SupplementalBalanceSheetInformationAbstract" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_FireAtVirginiaFacilityMember" name="FireAtVirginiaFacilityMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_TimeBasedRestrictedStockUnitsMember" name="TimeBasedRestrictedStockUnitsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" name="NumberOfBusinessDaysWithinWhichLenderMayRaiseObjectionsToAmendment" type="xbrli:durationItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsExercisable" type="xbrli:sharesItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false"/>
  <xsd:element id="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" name="SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsExercisableWeightedAverageRemainingContractualTerm" type="xbrli:durationItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_CreditAgreementSecondAmendmentMember" name="CreditAgreementSecondAmendmentMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_RailingMember" name="RailingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_PresidentAndChiefExecutiveOfficerMember" name="PresidentAndChiefExecutiveOfficerMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_NumberOfFinancialInstitutionWithDeposit" name="NumberOfFinancialInstitutionWithDeposit" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisableWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false"/>
  <xsd:element id="trex_AccruedCapitalProjectsCurrent" name="AccruedCapitalProjectsCurrent" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_PrepaidAndOtherCurrentAssetsDisclosureTextBlock" name="PrepaidAndOtherCurrentAssetsDisclosureTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_StagingMember" name="StagingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_OtherResidentialMember" name="OtherResidentialMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" name="TimeBasedRestrictedStockAndTimeBasedRestrictedStockUnitsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfStockAppreciationRightsActivityLineItems" name="ScheduleOfStockAppreciationRightsActivityLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_IndustrialRevenueBondsMember" name="IndustrialRevenueBondsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" name="PrepaidExpenseAndOtherAssetsCurrentTableTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_PerformanceBasedRestrictedStockUnitsMember" name="PerformanceBasedRestrictedStockUnitsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_InsuranceProceedsPolicyTextBlock" name="InsuranceProceedsPolicyTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ComponentsOfBasicAndDilutedEarningPerShareTable" name="ComponentsOfBasicAndDilutedEarningPerShareTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_RevolvingALoansMember" name="RevolvingALoansMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_GrossAssetAndLiability" name="GrossAssetAndLiability" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="debit"/>
  <xsd:element id="trex_EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" name="EnhanceDeckingAndTranscendSelectEnhanceAndSignatureRailingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SignatureRailingMember" name="SignatureRailingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_NewAccountingStandardsNotYetAdoptedPolicyTextBlock" name="NewAccountingStandardsNotYetAdoptedPolicyTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ScheduleOfSignificantAccountingPoliciesLineItems" name="ScheduleOfSignificantAccountingPoliciesLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SignatureRailingAndTranscendCladdingMember" name="SignatureRailingAndTranscendCladdingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ProductWarrantyMember" name="ProductWarrantyMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" name="DeferredTaxAssetsTaxCutAndJobsActCapitalizationOfResearchAndDevelopmentCosts" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="debit"/>
  <xsd:element id="trex_CapitalExpenditure" name="CapitalExpenditure" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_FifthAmendmentAndRestatedAgreementMember" name="FifthAmendmentAndRestatedAgreementMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_EBITDA" name="EBITDA" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" name="DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_ValuationAllowanceForCreditLossesAndDisputedAmounts" name="ValuationAllowanceForCreditLossesAndDisputedAmounts" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" name="ScheduleOfDivestureOfInterestsInSubsidiaryTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsExercisedWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_RawMaterialSupplyContractsMember" name="RawMaterialSupplyContractsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_RevolvingBLoanMember" name="RevolvingBLoanMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_StockAppreciationRightsMember" name="StockAppreciationRightsMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsOutstandingWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false"/>
  <xsd:element id="trex_ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" name="ProductsSoldPriorToJanuaryOneTwoThousandAndTwentyThreeMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfRestrictedStockActivityTable" name="ScheduleOfRestrictedStockActivityTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" name="ScheduleOfAccruedLiabilitiesAndOtherCurrentLiabilitiesTableTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_DeferredTaxAssetsOperatingLeaseLiabilities" name="DeferredTaxAssetsOperatingLeaseLiabilities" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="debit"/>
  <xsd:element id="trex_StockIssuedSharesEmployeeStockPurchasePlan" name="StockIssuedSharesEmployeeStockPurchasePlan" type="xbrli:sharesItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_EmployeeStockPurchasePlanMember" name="EmployeeStockPurchasePlanMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" name="NumberOfCustomerAccountedForTenPercentOrMoreAccountReceivable" type="xbrli:integerItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_TranscendDeckingMember" name="TranscendDeckingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" name="ScheduleOfDivestureOfInterestsInSubsidiaryAbstract" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_TrexCommercialProductsIncMember" name="TrexCommercialProductsIncMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_Rule10B51ArrModifiedFlag" name="Rule10B51ArrModifiedFlag" type="xbrli:booleanItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsAndMethodologyLineItems" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsGrantedWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_CommercialUseMember" name="CommercialUseMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_CustomerTwoMember" name="CustomerTwoMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" name="SupplementalFinancialInformationOfOperatingLeasesTableTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_TwoThousandFourteenStockIncentivePlanMember" name="TwoThousandFourteenStockIncentivePlanMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SurfaceFlakingMember" name="SurfaceFlakingMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfCommitmentsAndContingenciesTable" name="ScheduleOfCommitmentsAndContingenciesTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" name="SharebasedCompensationArrangementBySharebasedPaymentAwardNonOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm" type="xbrli:durationItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_MaturityPeriodOfCashEquivalent" name="MaturityPeriodOfCashEquivalent" type="xbrli:durationItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_AgreementDomain" name="AgreementDomain" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ResidentialUseMember" name="ResidentialUseMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionsEquityInstrumentsCanceledWeightedAverageGrantPrice" type="dtr-types:perShareItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_SurfaceFlakingWarrantyReserveMember" name="SurfaceFlakingWarrantyReserveMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_DeferredTaxLiabilitiesDepreciation" name="DeferredTaxLiabilitiesDepreciation" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_LineOfCreditFacilityAdditionalBorrowingCapacity" name="LineOfCreditFacilityAdditionalBorrowingCapacity" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_SensitivityChangeInSurfaceFlakingWarrantyReserve" name="SensitivityChangeInSurfaceFlakingWarrantyReserve" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" nillable="true" abstract="false" xbrli:balance="credit"/>
  <xsd:element id="trex_PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" name="PropertyPlantAndEquipmentEstimatedUsefulLifeTableTextBlock" type="dtr-types:textBlockItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" name="SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentageToTargetNumberOfShares" type="dtr-types:percentItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="false"/>
  <xsd:element id="trex_StockRepurchaseProgramMember" name="StockRepurchaseProgramMember" type="dtr-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" nillable="true" abstract="true"/>
  <xsd:element id="trex_ScheduleOfStockAppreciationRightsActivityTable" name="ScheduleOfStockAppreciationRightsActivityTable" type="xbrli:stringItemType" substitutionGroup="xbrldt:hypercubeItem" xbrli:periodType="duration" nillable="true" abstract="true"/>
</xsd:schema>
