Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Tab groups organise content into a container that shows one section at a time.
This component makes use of tabs and tab panels. Each tab must be slotted into the navigation slot and its panel must refer to a tab panel of the same name.
<pc-tab-group><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="custom">Custom</pc-tab><pc-tabslot="navigation"panel="advanced">Advanced</pc-tab><pc-tabslot="navigation"panel="disabled"disabled> Disabled</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="custom"> This is the custom tab panel.</pc-tab-panel><pc-tab-panelname="advanced"> This is the advanced tab panel.</pc-tab-panel><pc-tab-panelname="disabled"> This is a disabled tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Demos
Tabs on bottom
Tabs can be shown on the bottom by setting the placement attribute to bottom.
<pc-tab-groupplacement="bottom"><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="custom">Custom</pc-tab><pc-tabslot="navigation"panel="advanced">Advanced</pc-tab><pc-tabslot="navigation"panel="disabled"disabled> Disabled</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="custom"> This is the custom tab panel.</pc-tab-panel><pc-tab-panelname="advanced"> This is the advanced tab panel.</pc-tab-panel><pc-tab-panelname="disabled"> This is a disabled tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Tabs on start
Tabs can be shown on the starting side by setting the placement attribute to start.
<pc-tab-groupplacement="start"><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="custom">Custom</pc-tab><pc-tabslot="navigation"panel="advanced">Advanced</pc-tab><pc-tabslot="navigation"panel="disabled"disabled> Disabled</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="custom"> This is the custom tab panel.</pc-tab-panel><pc-tab-panelname="advanced"> This is the advanced tab panel.</pc-tab-panel><pc-tab-panelname="disabled"> This is a disabled tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Tabs on end
Tabs can be shown on the ending side by setting the placement attribute to end.
<pc-tab-groupplacement="end"><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="custom">Custom</pc-tab><pc-tabslot="navigation"panel="advanced">Advanced</pc-tab><pc-tabslot="navigation"panel="disabled"disabled> Disabled</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="custom"> This is the custom tab panel.</pc-tab-panel><pc-tab-panelname="advanced"> This is the advanced tab panel.</pc-tab-panel><pc-tab-panelname="disabled"> This is a disabled tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Closable tabs
Add the closable attribute to a tab to add a close button.
<pc-tab-groupclass="tabs-closable"><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="closable-1"closable> Closable 1</pc-tab><pc-tabslot="navigation"panel="closable-2"closable> Closable 2</pc-tab><pc-tabslot="navigation"panel="closable-3"closable> Closable 3</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="closable-1"> This is the first closable tab panel.</pc-tab-panel><pc-tab-panelname="closable-2"> This is the second closable tab panel.</pc-tab-panel><pc-tab-panelname="closable-3"> This is the third closable tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Scrolling tabs
When there are more tabs than horizontal space allows, the tab navigation bar will be scrollable.
<pc-tab-group><pc-tabslot="navigation"panel="tab-1">Tab 1</pc-tab><pc-tabslot="navigation"panel="tab-2">Tab 2</pc-tab><pc-tabslot="navigation"panel="tab-3">Tab 3</pc-tab><pc-tabslot="navigation"panel="tab-4">Tab 4</pc-tab><pc-tabslot="navigation"panel="tab-5">Tab 5</pc-tab><pc-tabslot="navigation"panel="tab-6">Tab 6</pc-tab><pc-tabslot="navigation"panel="tab-7">Tab 7</pc-tab><pc-tabslot="navigation"panel="tab-8">Tab 8</pc-tab><pc-tabslot="navigation"panel="tab-9">Tab 9</pc-tab><pc-tabslot="navigation"panel="tab-10">Tab 10</pc-tab><pc-tabslot="navigation"panel="tab-11">Tab 11</pc-tab><pc-tabslot="navigation"panel="tab-12">Tab 12</pc-tab><pc-tabslot="navigation"panel="tab-13">Tab 13</pc-tab><pc-tabslot="navigation"panel="tab-14">Tab 14</pc-tab><pc-tabslot="navigation"panel="tab-15">Tab 15</pc-tab><pc-tabslot="navigation"panel="tab-16">Tab 16</pc-tab><pc-tabslot="navigation"panel="tab-17">Tab 17</pc-tab><pc-tabslot="navigation"panel="tab-18">Tab 18</pc-tab><pc-tabslot="navigation"panel="tab-19">Tab 19</pc-tab><pc-tabslot="navigation"panel="tab-20">Tab 20</pc-tab><pc-tab-panelname="tab-1">This is the first tab panel.</pc-tab-panel><pc-tab-panelname="tab-2">This is the second tab panel.</pc-tab-panel><pc-tab-panelname="tab-3">This is the third tab panel.</pc-tab-panel><pc-tab-panelname="tab-4">This is the fourth tab panel.</pc-tab-panel><pc-tab-panelname="tab-5">This is the fifth tab panel.</pc-tab-panel><pc-tab-panelname="tab-6">This is the sixth tab panel.</pc-tab-panel><pc-tab-panelname="tab-7">This is the seventh tab panel.</pc-tab-panel><pc-tab-panelname="tab-8">This is the eighth tab panel.</pc-tab-panel><pc-tab-panelname="tab-9">This is the ninth tab panel.</pc-tab-panel><pc-tab-panelname="tab-10">This is the 10th tab panel.</pc-tab-panel><pc-tab-panelname="tab-11">This is the 11th tab panel.</pc-tab-panel><pc-tab-panelname="tab-12">This is the 12th tab panel.</pc-tab-panel><pc-tab-panelname="tab-13">This is the 13th tab panel.</pc-tab-panel><pc-tab-panelname="tab-14">This is the 14th tab panel.</pc-tab-panel><pc-tab-panelname="tab-15">This is the 15th tab panel.</pc-tab-panel><pc-tab-panelname="tab-16">This is the 16th tab panel.</pc-tab-panel><pc-tab-panelname="tab-17">This is the 17th tab panel.</pc-tab-panel><pc-tab-panelname="tab-18">This is the 18th tab panel.</pc-tab-panel><pc-tab-panelname="tab-19">This is the 19th tab panel.</pc-tab-panel><pc-tab-panelname="tab-20">This is the 20th tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Fixed scroll controls
When tabs are scrolled all the way to one side, the scroll button on that side isn’t visible. Set the fixed-scroll-controls to always show both scroll buttons.
<pc-tab-groupfixed-scroll-controls><pc-tabslot="navigation"panel="tab-1">Tab 1</pc-tab><pc-tabslot="navigation"panel="tab-2">Tab 2</pc-tab><pc-tabslot="navigation"panel="tab-3">Tab 3</pc-tab><pc-tabslot="navigation"panel="tab-4">Tab 4</pc-tab><pc-tabslot="navigation"panel="tab-5">Tab 5</pc-tab><pc-tabslot="navigation"panel="tab-6">Tab 6</pc-tab><pc-tabslot="navigation"panel="tab-7">Tab 7</pc-tab><pc-tabslot="navigation"panel="tab-8">Tab 8</pc-tab><pc-tabslot="navigation"panel="tab-9">Tab 9</pc-tab><pc-tabslot="navigation"panel="tab-10">Tab 10</pc-tab><pc-tabslot="navigation"panel="tab-11">Tab 11</pc-tab><pc-tabslot="navigation"panel="tab-12">Tab 12</pc-tab><pc-tabslot="navigation"panel="tab-13">Tab 13</pc-tab><pc-tabslot="navigation"panel="tab-14">Tab 14</pc-tab><pc-tabslot="navigation"panel="tab-15">Tab 15</pc-tab><pc-tabslot="navigation"panel="tab-16">Tab 16</pc-tab><pc-tabslot="navigation"panel="tab-17">Tab 17</pc-tab><pc-tabslot="navigation"panel="tab-18">Tab 18</pc-tab><pc-tabslot="navigation"panel="tab-19">Tab 19</pc-tab><pc-tabslot="navigation"panel="tab-20">Tab 20</pc-tab><pc-tab-panelname="tab-1">This is the first tab panel.</pc-tab-panel><pc-tab-panelname="tab-2">This is the second tab panel.</pc-tab-panel><pc-tab-panelname="tab-3">This is the third tab panel.</pc-tab-panel><pc-tab-panelname="tab-4">This is the fourth tab panel.</pc-tab-panel><pc-tab-panelname="tab-5">This is the fifth tab panel.</pc-tab-panel><pc-tab-panelname="tab-6">This is the sixth tab panel.</pc-tab-panel><pc-tab-panelname="tab-7">This is the seventh tab panel.</pc-tab-panel><pc-tab-panelname="tab-8">This is the eighth tab panel.</pc-tab-panel><pc-tab-panelname="tab-9">This is the ninth tab panel.</pc-tab-panel><pc-tab-panelname="tab-10">This is the 10th tab panel.</pc-tab-panel><pc-tab-panelname="tab-11">This is the 11th tab panel.</pc-tab-panel><pc-tab-panelname="tab-12">This is the 12th tab panel.</pc-tab-panel><pc-tab-panelname="tab-13">This is the 13th tab panel.</pc-tab-panel><pc-tab-panelname="tab-14">This is the 14th tab panel.</pc-tab-panel><pc-tab-panelname="tab-15">This is the 15th tab panel.</pc-tab-panel><pc-tab-panelname="tab-16">This is the 16th tab panel.</pc-tab-panel><pc-tab-panelname="tab-17">This is the 17th tab panel.</pc-tab-panel><pc-tab-panelname="tab-18">This is the 18th tab panel.</pc-tab-panel><pc-tab-panelname="tab-19">This is the 19th tab panel.</pc-tab-panel><pc-tab-panelname="tab-20">This is the 20th tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Manual activation
When focused, keyboard users can press ← and → to select the desired tab. By default, the corresponding tab panel will be shown immediately (automatic activation). You can change this behaviour by setting activation="manual" which will require the user to press Space or Enter before showing the tab panel (manual activation).
<pc-tab-groupactivation="manual"><pc-tabslot="navigation"panel="general">General</pc-tab><pc-tabslot="navigation"panel="custom">Custom</pc-tab><pc-tabslot="navigation"panel="advanced">Advanced</pc-tab><pc-tabslot="navigation"panel="disabled"disabled> Disabled</pc-tab><pc-tab-panelname="general"> This is the general tab panel.</pc-tab-panel><pc-tab-panelname="custom"> This is the custom tab panel.</pc-tab-panel><pc-tab-panelname="advanced"> This is the advanced tab panel.</pc-tab-panel><pc-tab-panelname="disabled"> This is a disabled tab panel.</pc-tab-panel></pc-tab-group>
CodeEdit
Eigenschaften
Name
Beschreibung
Reflektiert
Standard
placement
The placement of the tabs. Typ: "top" | "bottom" | "start" | "end"
"top"
activation
When this is set to auto, navigating the tabs with the arrow keys will instantly show the corresponding tab panel. If this is set to manual, the tab will receive focus but will not show the corresponding tab panel until the user presses Space or Enter/Return. Typ: "auto" | "manual"
"auto"
syncKey sync-key
When set, the active tab will be persisted in localStorage and synced with other tab groups using the same key. Typ: string | undefined
‐
noScrollControls no-scroll-controls
Hides the scroll buttons when tabs overflow. Typ: boolean
false
fixedScrollControls fixed-scroll-controls
Prevents the scroll buttons from being hidden when it isn’t needed. Typ: boolean
false
updateComplete
Ein schreibgeschütztes Promise, das erfüllt ist, sobald die Komponente fertig aktualisiert wurde.
Wenn du den Auto‐Loader oder den Standard‐Loader nutzt, kannst du diesen Abschnitt überspringen. Falls du dich für „Cherry‐Picking“ entschieden hast, kannst du die folgenden Snippets verwenden, um diese Komponente zu importieren.
CDN (Skript‐Tag)CDN (Import)npm (Import)
Um diese Komponente manuell vom CDN zu importieren, kannst du dieses Code‐Snippet kopieren und es in dein HTML einfügen.
Ui! Du bist in die gefährlichen Lande von Placer Toolkit geraten. Version 0 ist veraltet und entspricht nicht den EU‐Datenschutzstandards, einschließlich DSGVO.
Willst du die neuesten Kräfte, Sicherheit und Compliance? Bleib bei der aktuellen Version von Placer Toolkit!
Ups!Aufladen!
Unsere Website ist zu 100 % frei von Cookies! Wir legen großen Wert auf deine Privatsphäre und speichern daher keinerlei Cookies oder persönliche Informationen über dich.
Dein Browserverlauf bleibt sauber und deine Daten sind geschützt, ganz im Einklang mit modernen Datenschutzstandards wie der DSGVO. Genieße deinen Besuch ganz ohne digitale Cookies! 🍪🚫