-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
089e31e
commit fd206f0
Showing
3 changed files
with
37 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import styles from './TabNav.scss'; | ||
|
||
function TabNav ( props: { | ||
/** | ||
* Child node to be rendered as the inner HTML of the component. | ||
*/ | ||
children: React.ReactNode, | ||
} ) { | ||
return ( | ||
<nav className={styles.container}> | ||
<div className={styles[ 'scroll-container' ]}> | ||
<ul className={styles.tablist}> | ||
{props.children} | ||
</ul> | ||
</div> | ||
</nav> | ||
); | ||
} | ||
|
||
function TabNavItem ( props: { | ||
/** | ||
* Child node to be rendered as the inner HTML of the component. | ||
*/ | ||
children: React.ReactNode, | ||
|
||
/** | ||
* Whether this is the currently active tab. Applies | ||
* `aria-current="true"`. Only one tab may be active at a time. | ||
*/ | ||
isActive: boolean, | ||
} ) { | ||
return <li aria-current={props.isActive} className={styles.tab}>{props.children}</li>; | ||
} | ||
|
||
export { TabNav, TabNavItem }; |