Ant Design
Describe the design of the component, thinking through several perspectives:
Outline the key elements of the component’s public API surface, taking into consideration conformance guidelines. Make sure to discuss differences and rationalizations. Consider high and low-level APIs. Attempt to design a powerful and extensible low-level API with a high-level API for developer/designer ergonomics and simplicity.
Tabs
Property Name | Attribute Name | Type | Default Value | Description |
---|---|---|---|---|
orientation | orientation | enum | horizontal | horizontal or vertical |
activeid | activeid | string | id of the active element. | |
activeindicator | activeindicator | boolean | true |
Tab
Property Name | Attribute Name | Type | Default Value | Description |
---|---|---|---|---|
id | id | string |
Tab Panel
Property Name | Attribute Name | Type | Default Value | Description |
---|---|---|---|---|
id | id | string |
Example Table
Signature | Description |
---|---|
increment(value: number = this.step): void | Increments the value of the component by the amount specified by step , clamped within min /max values. |
decrement(value: number = this.step): void | Decrements the value of the component by the amount specified by step , clamped within min /max values. |
Example Table
Event Name | Detail Type | Bubbles | Composed | Cancellable | Dispatch Behavior |
---|---|---|---|---|---|
change | none | true | true | false | fires when component activetab updates. |
Screenshots and/or description of the basic appearance of the component.
Outline the component’s structure with a diagram of its render tree. Enumerate key areas of visual composition and customization.
Example
Template:
<div class="tabs" class="tabs">
<slot class="start" name="start" part="start"></slot>
<div class="tablist" part="tablist" role="tablist" aria-label="Sample Tabs">
<button
class="tab"
part="tab"
role="tab"
aria-selected="true"
aria-controls="panel-1"
id="tab-1"
tabindex="0"
>
Tab One
</button>
<button
class="tab"
part="tab"
role="tab"
aria-selected="false"
aria-controls="panel-2"
id="tab-2"
tabindex="-1"
>
Tab Two
</button>
<button
class="tab"
part="tab"
role="tab"
aria-selected="false"
aria-controls="panel-3"
id="tab-3"
tabindex="-1"
>
Tab Three
</button>
<div class="activeindicator" part="activeindicator"></div>
</div>
<slot class="end" name="end" part="end"></slot>
<div
class="tabpanel"
part="tabpanel"
id="panel-1"
role="tabpanel"
tabindex="0"
aria-labelledby="tab-1"
>
Content of the first tab
</div>
<div
class="tabpanel"
part="tabpanel"
id="panel-2"
role="tabpanel"
tabindex="0"
aria-labelledby="tab-2"
hidden
>
Content of the second tab
</div>
<div
class="tabpanel"
part="tabpanel"
id="panel-3"
role="tabpanel"
tabindex="0"
aria-labelledby="tab-3"
hidden
>
Content of the third tab
</div>
</div>
Tabs
Slot Name | Description | Fallback Content |
---|---|---|
start | ||
end |
Tab
Slot Name | Description | Fallback Content |
---|---|---|
start | ||
end |
What classes does the component add to the host element?
Class Name | Description |
---|
What classes on slotted content does the component respond to?
Class Name | Description |
---|
Tabs
Part Name | Description |
---|---|
tabs | |
tablist | |
tab | |
tabpanel | |
activeindicator |
Tabs can either be controlled or uncontrolled, meaning if activeid
is passed the app author is taking control of the selected tab. When the change
event fires it updates the activeid
and pass a reference to the activetab
.
List key component states, valid state transitions, and how interactions trigger state transitions.
Example Table
State Group | States | Initial State | Description | Interaction/Transition |
---|---|---|---|---|
disabled | true /false | false | When true , disables the control, preventing user interaction and displaying the control with a disabled appearance. | No interaction. Controlled programmatically. |
Consider the accessibility of the component.
Arrow vs tabbing key behavior
Modifier key effects (e.g. shift, ctrl, meta)
Does this component use focus delegation?
What is the behavior around disabled tabs?
What is the behavior around tabs that move around in the UI (i.e. using flexbox order to move the active tab to be “first” in the tabgroup?
Example Table
Key | Description |
---|---|
Up/Right | Increments the value of the component by calling the increment method. If the shift modifier is pressed, increases by 10x the step value. |
Down/Left | Decrements the value of the component by calling the decrement method. If the shift modifier is pressed, decreases by 10x the step value. |
Does this component integrate with form submission, form validation, etc.? Can integration be accomplish with standard APIs or are special work-arounds required?
Are there any details about shadow dom, focus delegation, or aria attributes that need special attention?
Tabs should mirror in RTL languages, meaning the tabs and tab content should flip direction.
Are there any security implications surrounding the component?
Are there any performance pitfalls or challenges with implementing the component? (examples below)
Will implementing the component require taking on any dependencies?
Are there any core web platform features that are needed to implement this component well?
Are there any special considerations for DevTools? Will tooling changes need to be made? Is there a special way to light up this component in DevTools that would be compelling for developers/designers?
What next steps, if any, are there? Is there some functionality that would be a nice-to-have or a common feature in other implementations that could be added but is not considered part of the MVP? Link all feature additions, modifications, bugs, or editorial change issues.