setIndex(i)}
+ onClick={() =>
+ setState({
+ stepIndex: i,
+ step: editorSteps[i],
+ })
+ }
className="ch-spotlight-tab"
data-selected={
- i === stepIndex ? "true" : undefined
+ i === state.stepIndex ? "true" : undefined
}
>
{children}
@@ -52,7 +69,11 @@ export function Spotlight({
)}
void
}
function TabsContainer({
tabs,
@@ -138,6 +143,7 @@ function TabsContainer({
topBorder,
panel,
theme,
+ onTabClick,
}: TabsContainerProps) {
const c = useClasser("ch-editor-tab")
return (
@@ -189,6 +195,7 @@ function TabsContainer({
: ColorName.InactiveTabBackground
),
}}
+ onClick={onTabClick && (() => onTabClick(title))}
>
{title}
diff --git a/packages/playground/content/scrollycoding-demo.mdx b/packages/playground/content/scrollycoding-demo.mdx
index ae852e9d..0ef58add 100644
--- a/packages/playground/content/scrollycoding-demo.mdx
+++ b/packages/playground/content/scrollycoding-demo.mdx
@@ -16,6 +16,8 @@ Lorem ipsum dolor sit amet, consectetur adipiscing something about points, sed d
Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.
+