Coder Social home page Coder Social logo

react_tabs-js's Introduction

React Tabs (JS)

Implement the Tabs component that renders several tabs and allows the user to switch between them.

Here is the working version

The App should communicate with the Tabs component using the following props:

  • tabs - an array of tab objects to be rendered as Tabs;
  • activeTabId - the id of the tab that should be active;
  • onTabSelected - a callback executed with the id of a just selected tab when the user clicks on it.

The Tabs component should be stateless (does not have an internal state, only props).

Follow the next requirements to pass the tests:

  1. Render tabs in a list (<ul>);
  2. Each <li> should have a data-cy="Tab".
  3. The <li> of an active tab should have the is-active class.
  4. If activeTabId does not match any object in the tabs array, the first one should be active.
  5. Add a link with data-cy="TabLink" and a href to #tab-id inside every <li> (see the markup).
  6. The Tabs component should render the content of the active tab in the element with data-cy="TabContent".
  7. Call onTabSelected only when the user selects a non-active tab.
  8. Use the title of the active tab in the <h1> of the App component in the following format: Selected tab is Tab 1.

Instructions

  • Install the Prettier Extension and use these VSCode settings to enable format on save.
  • Implement a solution following the React task guidelines.
  • Open one more terminal and run tests with npm test to ensure your solution is correct.
  • Replace <your_account> with your Github username in the DEMO LINK and add it to the PR description.

react_tabs-js's People

Contributors

danheim avatar ihor-karpyn avatar marina-tilniak avatar mgrinko avatar mhrynko avatar mykhalenych avatar mykola-yarchuk avatar oleksandra-pasenchenko avatar solaryasha avatar vpolets avatar yuriiholiuk avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.