Angular does not provide one official “tree table” component. Build this interface by combining a hierarchy model and expansion behavior (tree patterns) with a tabular renderer (CDK or Angular Material table). Then choose native table markup or the documented flex-based alternative according to your sizing and semantics requirements.
Choose the interaction model first
The most important decision is whether rows are merely indented or behave as a real tree.
Real tree behavior
Use a tree pattern when users must expand and collapse nodes, move through the hierarchy with the keyboard, and understand parent–child relationships as a navigable structure. Typical examples include file and document hierarchies, nested menus, organization charts, hierarchical browsing, and nested site navigation.
A true tree requires tree roles, levels, expanded state, and keyboard handling consistent with Angular’s tree guidance. A table that happens to indent child rows does not automatically provide those semantics.
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Indented table rows
Use a table with visual indentation when the primary task is comparing columns—such as owner, status, date, or amount—and hierarchy is supporting context. Add an explicit expand/collapse button and an accessible label, but do not describe the result as a fully navigable tree unless you implement tree interactions and semantics.
Compose the Angular pieces
Keep the data and behavior separate from presentation:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- Hierarchy model: represent each node with an identifier, parent relationship, depth, children, and expansion state.
- Flattened view: derive the rows currently visible after expansion. Each row should retain its depth so the first column can indent it.
- Table layer: use
mat-tablewhen you want Material styling and integrations, or the lower-level CDK table when you need an unopinionated, highly customized renderer. - Tree behavior: use the tree patterns and accessibility model when keyboard navigation and hierarchical semantics are requirements.
Angular Material schematics can scaffold a table data source with sorting and pagination, and a separate mat-tree for nested folders. They do not generate a combined tree-table component, so the flattening, expansion, and interaction code remains application-specific.
Implement a Material table with expandable hierarchy
The following pattern keeps a table’s columns while exposing expansion through the first column. The exact imports and APIs should match the Angular and Material version used by your application.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
1. Define nodes and visible rows
export interface AccountNode {
id: string;
name: string;
owner: string;
status: string;
children?: AccountNode[];
}
export interface AccountRow extends AccountNode {
depth: number;
expandable: boolean;
}
expanded = new Set<string>();
flatten(nodes: AccountNode[], depth = 0): AccountRow[] {
const rows: AccountRow[] = [];
for (const node of nodes) {
const children = node.children ?? [];
rows.push({ ...node, depth, expandable: children.length > 0 });
if (this.expanded.has(node.id)) {
rows.push(...this.flatten(children, depth + 1));
}
}
return rows;
}
toggle(row: AccountRow): void {
if (!row.expandable) return;
this.expanded.has(row.id)
? this.expanded.delete(row.id)
: this.expanded.add(row.id);
this.dataSource.data = this.flatten(this.rootNodes);
}
2. Render columns and the expansion control
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>Name</th>
<td mat-cell *matCellDef="let row">
<button
*ngIf="row.expandable"
type="button"
mat-icon-button
[attr.aria-label]="(expanded.has(row.id) ? 'Collapse ' : 'Expand ') + row.name"
[attr.aria-expanded]="expanded.has(row.id)"
(click)="toggle(row)">
<mat-icon>{{ expanded.has(row.id) ? 'expand_more' : 'chevron_right' }}</mat-icon>
</button>
<span class="tree-label" [style.--depth]="row.depth">{{ row.name }}</span>
</td>
</ng-container>
<ng-container matColumnDef="owner">
<th mat-header-cell *matHeaderCellDef>Owner</th>
<td mat-cell *matCellDef="let row">{{ row.owner }}</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>Status</th>
<td mat-cell *matCellDef="let row">{{ row.status }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
.tree-label {
display: inline-block;
padding-inline-start: calc(var(--depth) * 1.5rem);
}
This is an expandable, indented table. If users must move between nodes with tree-specific keyboard behavior, add the corresponding tree semantics and interaction model rather than relying on indentation alone.
Use native or flex-based table layout deliberately
Angular Material documentation describes a flex-based table alternative that replaces native HTML table elements with flex containers. It can help when you need CSS-driven responsive sizing or custom row layouts, but verify the markup against the version installed in your application because the documented example is versioned.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
| Choice | Best fit | Important limitation |
|---|---|---|
| Native Material/CDK table | Conventional columns, table semantics, sorting, pagination, and sticky columns | Column sizing follows table-layout behavior and browser table rules. |
| Flex-based Material table | CSS flex sizing, custom responsive arrangements, or nonstandard row presentation | It does not behave like a native table in every layout and accessibility detail. |
In current CDK source, fixedLayout enforces consistent column widths and optimizes sticky-style work for native tables. It is a no-op for flex tables, so do not use that input as a flex-column sizing control.
Sorting, pagination, and expansion state
Apply sorting and pagination to the flattened rows only when that matches the user’s mental model. Paginating visible descendants can separate a parent from its children; paginating top-level branches first may be clearer for large hierarchies. Preserve expansion by stable node IDs, not array indexes, so refreshes and sorting do not open the wrong branch.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Recompute the flattened data after every expansion or collapse.
- Keep expansion state separate from server data so a reload does not mutate the domain model.
- For lazy-loaded children, expose a loading state on the parent row and announce errors in an accessible status region.
- When filtering, decide whether to show matching descendants alone or include their ancestor path; document that behavior in the UI.
Accessibility checklist
- Give every expand/collapse control an accessible name containing the node name.
- Reflect state with
aria-expanded; do not use an icon alone. - Keep focus on the control after expansion and collapse.
- For a true tree, implement the documented tree keyboard model, levels, and relationships; test with keyboard-only navigation and a screen reader.
- Ensure indentation is not the sole indication of parentage; provide text or semantic relationships as appropriate.
- Check contrast, focus visibility, and hit-target size at every depth.
Should you use Angular Flex-Layout?
The Angular Flex-Layout repository states that the Angular team no longer publishes new releases. It exposes Flexbox and media-query APIs, but a new feature should first verify package compatibility with the project’s Angular version and consider ordinary CSS layout instead. This decision is independent of whether the hierarchy is rendered with a table or a tree.
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Decision guide
| Requirement | Recommended approach |
|---|---|
| Keyboard-navigable hierarchy | Implement a genuine tree interaction model; add tabular columns only where they do not weaken tree semantics. |
| Column comparison with optional nesting | Flatten the hierarchy into a Material or CDK table and provide explicit expansion controls. |
| Material styling plus sorting or pagination | Start with mat-table and its data-source patterns. |
| Maximum rendering control | Use the CDK table and supply your own templates and styles. |
| Responsive flex sizing | Evaluate the versioned flex-table pattern, remembering that fixedLayout does not size flex columns. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

