react-tabs not styled as tabs

5.7k views Asked by At

Just trying to get a basic example of react-tabs working. The styling seems to be missing. The example below is in code sandbox (look in 'Hello.js'), but I see exactly the same behavior after installing the package into my project via npm. What am I missing? Thanks!

https://codesandbox.io/s/jzql1q6819

1

There are 1 answers

0
Pop-A-Stash On BEST ANSWER

From the docs at https://github.com/reactjs/react-tabs#styling

react-tabs does not include any style loading by default. Default stylesheets are provided and can be included in your application if desired.

You will have to import the styles yourself. I don't think Code Sandbox will let you import them directly from the NPM package, so you will have to use a CDN or other source.

Besides that, the tabs are working in your example. Clicking a list item reveals different content

Here is a fork of your example with the styles added: https://codesandbox.io/s/ym7l2zk4oj