@ftchinese/ftc-pushdownmenu-react

The pushdown menu for language selection partial of ftc-header. It is the react version.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@ftchinese/ftc-pushdownmenu-react
1.3.34 years ago4 years agoMinified + gzip package size for @ftchinese/ftc-pushdownmenu-react in KB

Readme

ftc-pushdownmenu-react
The pushdown menu component for FTC. React version. It is a part of ftc-header-react.

Install

```cmd cd yourProject npm install react react-dom prop-types npm install "@ftchinese/ftc-pushdownmenu-react" --save ```

Usage

Example: ```js import {PushdownMenu, PushdownItem} from '@ftchinese/ftc-pushdownmenu-react'; import React from 'react'; import ReactDOM from 'react-dom'; ReactDOM.render(
<PushdownItem name={"简体中文"} url={"#"} selected={true} />
<PushdownItem name={"繁体中文"} url={"http://big5.ftchinese.com/"} />
<PushdownItem name={"英文"} url={"https://www.ft.com/"} />
, document.getElementById('root') ); ```

Props

Props of PushdownMenu

children

Must be a or an array of PushdownItem

Props of PushdownItem

name

Type string. Required. The name of the list item.

url

Type string. Optional. Default '#'. The url site to which you jump when clicking the list item.

selected

Type boolean. Required. Decide the item is shown or not when the pushdown menu is shrinked. That's to say, the item with prop selected = {true} will be shown on the top of the menu, and it is only shown when the menu is shrinked.