![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
iconical-tab-nav
Advanced tools
A Tab Navigation component that can be either text or icon based
A Tab Navigation component that can be either text or icon based
Check out the demo.
npm install --save iconical-tab-nav
This library has been designed to work with material icons by default. In order to use material icons you must include the following line in your application.
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
You can then use any of the icons available at https://material.io/tools/icons/ by passing in the relevant string to the 'icon' prop.
import * as React from 'react'
import IconicalTabNav from 'iconical-tab-nav'
class Example extends React.Component {
render () {
return (
<IconicalTabNav
tabs={
[
{ label: 'Home', icon: 'home', render: ()=> <div>Tab One</div>},
{ label: 'Favourites', icon: 'favorite', render: ()=> <div>Tab Two</div>}
]
}/>
)
}
}
Tab
IconicalTabNav has one required prop, tabs, that takes a Tab[].
The interface for Tab is as follows:
interface Tab {
label?: string
icon?: string
}
In order for the icon to render, the string passed in must match an icon in the material icons set. https://material.io/tools/icons/
Props
name | type | default | description |
---|---|---|---|
tabs (required) | Tab[] | (see above) | |
showLabels | boolean | false | show text labels |
hideIcons | boolean | false | show icon labels |
containerStyles | ContainerStyles | (see styles) | (see styles) |
tabStyles | TabStyles | (see styles) | (see styles) |
selectedStyles | TabStyles | (see styles) | (see styles) |
labelStyles | LabelStyles | (see styles) | (see styles) |
hoverColour | string | #dfe3e6 | The background color of the tab when moused over |
selected | number / 'none' | 'none' | The index of the default tab selection (e.g. 0) |
iconSize | enum('s', 'm', 'l', 'xl') | 'm' | Size of the icon, as per material design standards (s: 18px, m: 24px, l: 32px, xl: 48px) |
selectedColour | string | #008673 | The color of the text and icon when active |
defaultColor | string | #8897a2 | The color of the text and the icon when inactive |
reverse | boolean | false | Indicates whether the tabs should sit at the top or the bottom of the container. Default is at the top, if reverse is set to true then tabs will sit at the bottom |
Styles
IconicalTabNav has default styling applied so there should be no need to apply futher styles unless desired. It takes style objects for the container component, tabs and the labels and is therefore the styling is highly customisable.
For containerStyles these are the expected values:
interface ContainerStyles {
backgroundColour?: string (default white)
padding?: string
}
These styles are applied to the container that wraps the tabs.
For tabStyles and selectedStyles these are the expected values:
interface TabStyles {
padding?: string
}
These styles are applied to the tab divs. tabStyles are applied to all tabs, selectedStyles are applied to the currently selected tab.
For labelStyles these are the expected values:
interface LabelStyles {
margin?: string
fontSize?: string
}
These styles are applied to the label, both text and icon.
But you can pass any valid styles through these objects as they are passed directly in to the component.
MIT © kipurc
FAQs
A Tab Navigation component that can be either text or icon based
The npm package iconical-tab-nav receives a total of 2 weekly downloads. As such, iconical-tab-nav popularity was classified as not popular.
We found that iconical-tab-nav demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.