Struggling with documentation - add different content under different tabs (React) #4936
-
Hi, I am new to React and ElasticUI. I trying to expand the following code example from https://elastic.github.io/eui/#/layout/page#a-simple-page-with-tabs by adding some content under each tab. I cannot find any React example that explains how to add content into two or more different tabs. I tried the Can you please help? Thank you, __ Example from the above URI: ` import { export default ({ button = <></>, content }) => ( |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @mapdegree, 👋🏽 I'm converting this issue into a discussion because it seems more like a Q&A. |
Beta Was this translation helpful? Give feedback.
-
You can add a This is a very basic example (you can create something more dynamic): https://codesandbox.io/s/nifty-meitner-cqd9v?file=/index.js. Let me know if this answer was helpful. |
Beta Was this translation helpful? Give feedback.
You can add a
onClick
to each object of yourtabs[]
and save into a state what is the current selected tab. Then you can render your content based on your selection.This is a very basic example (you can create something more dynamic): https://codesandbox.io/s/nifty-meitner-cqd9v?file=/index.js.
Let me know if this answer was helpful.