0.3.6 • Published 3 years ago

tabylonia v0.3.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

PREQREQUISITES:

  • React environment
  • package.json ->
    • {"type": "module"}

Installation ->

npm i tabylonia --save

Import module

import { Tabylon } from 'tabylonia'

Basic HTML Element

<Tabylon />

Advance HTML Element with options

<Tabylon
    containerStyle={containerStyle}
    tabBarStyle={tabBarStyle}
    tabStyle={tabStyle}
    activeComponentStyle={activeComponentStyle}
    data={data}
    themeType='light'
/>

OPTIONS

NamePropTypeDefault valueDescription
bgcolorstringrgba(0,0,0)background color for element container
fcolorsgtringrgba(255,255,255)initial font color for entire element
dcolorstringrgba(255,255,255,.5)initial text decoration color
containerStyle = {
        bgcolor: 'rgba(0,0,0)',
        fcolor: 'rgba(255,255,255)',
        dcolor: 'rgba(255,255,255,.5)'
    }
NamePropTypeDefault valueDescription
heightstring'5em'starting height of tab bar
widthstring'100%'starting width of tab bar
tabBarStyle: {
        height: '5em',
        width: '100%',
    }
NamePropTypeDefault valueDescription
titleAlignstring'center'alignment of tab title when not active
titleAlignActivestring'flex-start'alignment of tab title when active
stylestring'standard'tab theme definer (not done)
growbooleanfalsetrue: applies flex grow (tabs grow to take all availabe space when active), false: sets static witdth of tabs
bcolorstring'rgba(255, 255, 255, 0.5)'non-active tab background color
acolorstring'rgba(255,255,255)'active tab background color
tabStyle = {
        titleAlign: 'center',
        titleAlignActive: 'flex-start',
        style: 'standard',
        grow: false,
        bcolor: 'rgba(255, 255, 255, 0.5)',
        acolor: 'rgba(255,255,255)',
    }
NamePropTypeDefault valueDescription
bgcolorstring'rgba(255,255,255)'active panel background color (img/video capability coming next)
flexDirectionstring'column'flex direction
justifyContentstring'center'horizontal align
alignItemsstring'center'vertical align
activeComponentStyle = {
        bgcolor: 'rgba(255,255,255)',
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center'
    }

themeType = 'light' OR themeType = 'standard' OR themeType = 'browser'

height = '100%' width = '100%'

Until I can really nail down the sizing of the element by passing props (doesn't quite work the way I expected it too... I guess I should have expected that), use a parent element inside the client to generate size constraints and leaving the height and width props at 100% OR not including them at all as they are packaged as defaults anyway

<div className="holder">
    <Tabylon (...props) />
</div>
________________________

.holder {
    width: 50%;
    max-height: 50%;
    display: flex;
    flex: 1 1 auto;
}

margin = '0 auto'

Each constituent object of the data array must have at least three named properties, name, tabContent.subtitle and data. Name is the tab identifier, tabContent.subtitle is the text content of the tab, and data is the component passed to the active panel.

THE DATA OBJECT:
the component passed into the data property will show up in the active container panel.

data: [
        {
            name: 'one', 
            tabContent: {
                subtitle: 'Weather',
            },
            activeTabContent: {
                elOne: {
                    title: 'link one',
                    alt: 'link one',
                    link: '/'
                },
                elTwo: {
                    title: 'link two',
                    alt: 'link two',
                    link: '/'
                },
            },
            data: <Component />
        },
        {
            name: 'two', 
            tabContent: {
                subtitle: 'Finance',
            },
            activeTabContent: {
                elOne: {
                    title: 'link one',
                    alt: 'link one',
                    link: '/'
                },
                elTwo: {
                    title: 'link two',
                    alt: 'link two',
                    link: '/'
                },
            },
            data: <Component />
        },
        {
            name: 'three', 
            tabContent: {
                subtitle: 'Golf',
            },
            activeTabContent: {
                elOne: {
                    title: 'link one',
                    alt: 'link one',
                    link: '/'
                },
                elTwo: {
                    title: 'link two',
                    alt: 'link two',
                    link: '/'
                },
            },
            data: <Component />
        },
        {
            name: 'four', 
            tabContent: {
                subtitle: 'Random',
            },
            activeTabContent: {
                elOne: {
                    title: 'link one',
                    alt: 'link one',
                    link: '/'
                },
                elTwo: {
                    title: 'link two',
                    alt: 'link two',
                    link: '/'
                },
            },
            data: <Component />
        },

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the UnLicense. See LICENSE for more information.

Contact