Giter Site home page Giter Site logo

react_tabs's Introduction

React Tabs

Implement the App and Tabs components to render and switch between given tabs.

Here is the working version

  1. Save the selectedTabId in the App (the first tab is selected by default);
  2. Implement the Tabs component accepting tabs as a prop and displaying a link per each tab and the content of the selected tab.
  3. Each link should have a href with a #tab-id (see the markup).
  4. Pass the selectedTabId as a prop to the Tabs, the specified tab should be selected if possible (otherwise, the first tab is selected).
  5. The Tabs should show the content of the selected tab (add an attribute data-cy="TabContent" for testing).
  6. The selected tab (li) should have an is-active class.
  7. Pass the onTabSelected callback to the Tabs, it should be called whenever the user selects another tab. (Don't call the callback if the tab was not changed)
  8. The callback should receive the data of the selected tab (an object from the array)
  9. The App title (h1) should show a text saying Selected tab is Tab 1 (show the title of the selected tab).
  10. When the user selects another tab the h1 should be updated accordingly.
  11. The Tabs component should be stateless (don't have an internal state, only props).

Instructions

react_tabs's People

Contributors

yuriiholiuk avatar mgrinko avatar vpolets avatar oleksandra-pasenchenko avatar solaryasha avatar mykola-yarchuk avatar danheim avatar ihor-karpyn avatar d-wasilewski 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.