Tab List
Display the tab buttons for a tabbed interface.
- Name:
core/tab-list - Category: design
- API Version: 3
- Block Type: Hybrid (static save + server enhancements)
Block Relationships
Parent blocks (direct):
– core/tabs
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
tabs |
array |
[] |
Source: query. Selector: button |
Supports
Defined via the supports property in block.json.
html:falseariaLabel:truevisibility:falselock:falsebackground:backgroundImage:truebackgroundSize:truegradient:true
color:background:truetext:true
typography:fontSize:truelineHeight:true
layout:default:{"type":"flex","flexWrap":"wrap"}allowVerticalAlignment:falseallowOrientation:falseallowWrap:false
spacing:padding:trueblockGap:true
shadow:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
core/tabs-list
CSS Selectors
Defined via the selectors property in block.json.
- background:
.wp-block-tab-list button - border:
.wp-block-tab-list button - shadow:
.wp-block-tab-list button - color:
- background:
.wp-block-tab-list button - text:
.wp-block-tab-list button
- background:
- spacing:
- padding:
.wp-block-tab-list button
- padding:
Block Markup
This is a hybrid block. It saves static markup that the server may enhance during rendering.
<!-- wp:tab-list -->
<div role="tablist" class="wp-block-tab-list"><button type="button" role="tab">Tab 1</button><button type="button" role="tab">Tab 2</button></div>
<!-- /wp:tab-list -->
Source
- block.json (reference)
- Source directory — browse the
editandsavesource files,index.php, and more.
这篇文档对你有帮助吗?
谢谢你的反馈!