1.0.14 • Published 1 year ago

gallery-ar-component v1.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

gallery-ar-component License: MIT

'gallery-ar-component' is a customizable, lightweight library for creating a responsive image gallery carousel. It is designed to be easy to use and integrate into your project with minimal setup.

Table of contents

Examples

  1. Image carousel
  2. Video carousel

Installation

gallery-ar-component

To install and set up the library, run:

$ npm install gallery-ar-component

Usage

import { CarouselComponent } from 'gallery-ar-component';

Pass data for each TAB in the format below:

const tabsData = [
  {
    tabLabel: 'yourTabLabelName',
    color: 'color',
    image:
      'https://images.unsplash.com/photo-1618005198919-d3d4b5a92ead?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1674&q=80',
    text: 'Your text',
  },
  {
    tabLabel: 'yourTabLabelName',
    color: '#212121',
    video:
      'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
    text: 'Your text',
  },
  ...
];

Tabs Data accepts:

NameType
tabLabelstring
colorstring
imagestring
videostring
textstring
htmlContentstring
imgHorizontalPointstring: 'left','center','right'
imgVerticalPointstring: 'top','center','bottom'
imgHorizontalPointMobilestring: 'left','center','right'
imgVerticalPointMobilestring: 'top','center','bottom'
componentEx.: component: nameOfComponent

Example:

<CarouselComponent
  tabsData={tabsData}
  width={50}
  height={60}
  navigationPosition={'bottom'}
  dotSize={4}
  dotMargin={1}
/>

Properties

  • Dimentions of the carousel

    PropertiesRequirementVariationsDescription
    tabsDataRequiredformat displayed above - UsageData for each tab to display.
    widthRequirednumberWidth of the Gallery in vw.
    heightRequirednumberHeight of the Gallery in vh.
    mobileWidthnumberWidth in the mobile version in vw. If it not provided then it will use the desk width width.
    mobileHeightnumberHeight in the mobile version in vh_. If it not provided then it will use the desk height height.
    borderRadiusnumberBorder radius of the gallery in px.
    mobileBorderRadiusnumberMobile border radius in px. Accepts values from 1 and greater. If 0 provided it will take the desk border radius.
  • Navigation

    • Dot Navigation

      PropertiesRequirementVariationsDescription
      navigationbooleanShow dot navigation.
      navigationPosition'bottom', 'bottom-left','bottom-right', 'top', 'top-left', 'top-right', 'left', 'left-top', 'left-bottom','right', 'right-top', 'right-bottom'Navigation Position.
      dotSizenumberSize of dot navigation buttons in px.
      mobileDotSizenumberMobile size of dot nav.igation buttons in px. If not provided then it will use desk dot size.
      dotColorhex color, stringColor of dot buttons
      dotColorHoverhex color, stringColor of dot buttons on hover/focus.
      dotColorActivehex color, stringColor of active dot button.
      dotRadiusnumberRadius of dot buttons.
      dotMarginstringMargin around the buttons in vw. Ex.: '1 2 1 2' (top, right, bottom, and left), '1' is 1vw on top, bottom, 2vw on left and right.
      dotMarginMobilestringMargin around the buttons in mobile in vw. Ex.: '1 2 1 2' (top, right, bottom, and left), '1' is 1vw on top, bottom, 2vw on left and right.
      dotBordernumberBorder width for dot navigation in px.
      dotBorderColorhex color, stringColor of the border.
      navigationBorderbooleanTrue if to include border.
      navigationBorderSizenumberSize of the navigation box in px. Only for top, bottom, left and right alighnment. NOT for top-left, etc.
      navigationBorderColorhex color, stringColor of the navigation box.
    • Arrow Navigation

      PropertiesRequirementVariationsDescription
      arrowNavigationbooleanShow arrow navigation. If true two arrows appear to switch tabs back and forward.
      arrowButtonsBorderbooleanTrue if to include arrow button borders.
      arrowButtonsBorderSizenumberSize of the arrow buttons box in px.
      arrowButtonsColorhex color, stringColor of the navigation box.
      arrowButtonBorderRadiusnumberRadius of arrow button.
      arrowButtonSizestringPadding around the arrow buttons in px. Ex.: '1 2 1 2' (top, right, bottom, and left), '1' is 1px on top, bottom, 2px on left and right. Other example '1 2' is 1px 2px.
      arrowButtonMarginstringMargin around arrow button in px. Ex.: '1 2 1 2' (top, right, bottom, and left), '1' is 1px on top, bottom, 2px on left and right. Other example '1 2' is 1px 2px.
      arrowButtonBackgroundColorhex color, stringColor of the arrow button background.
      arrowColorhex color, stringArrow icon color.
  • Content

    PropertiesRequirementVariationsDescription
    textPosition'left-center', 'center, 'right-center', 'top-center', 'bottom-center'Position of text
    contentDirection'row', 'column'Direction of content if dataTabs contains text and html content.
    textWidthnumberWidth of the text(it includes text/hmtl/component content) content in vw.
    textHeightnumberHeight of the text(it includes text/hmtl/component content) content in vh.
    mobileTextWidthnumberWidth of the text(it includes text/hmtl/component content) content in vw.
    mobileTextHeightnumberHeight of the text(it includes text/hmtl/component content) content in vh.
    textContentWidthnumberRegular Text content width in vw.
    textContentDisplay'flex', 'grid'How to display the content
    gridGapnumberFor the grid content display to add columns and rows gap if there is a need in px.
    numberGridColumnsnumberNumber of columns for grid
    mobileNumberGridColumnsnumberMobile number of grid columns
    fontSizenumberSize of the font in px.
    mobileFontSizenumberMobile size of the font in px.
    contentBorderbooleanTrue if to include content border.
    contentBordersColorhex color, stringColor of border of content box.
    contentBordersSizenumberWidth of border of content box.
  • Mask Images

    PropertiesRequirementVariationsDescription
    splitImageAlignment'top', 'bottom', 'left', 'right'Mask image alignment.
    tearFilestringImport image .png as import nameYourImage from path/imageFile.png in your component and insert into <CarouselComponent tearFile={nameYourImage}/>. Example of image please take in the src/Carousel/images file.
    widthOfMasknumberWidth of the mask. Available for 'left' and 'right mask currently.
  • Background position (Ex.: image, video)

    PropertiesRequirementVariationsDescription
    backgroundPositionstringBackground(image) position. Ex.:top 20px right 30px. First value is top/bottom, second value right/left and px number.

Author

Alyona Rodina

License

Copyright © 2022, Alyona Rodina. Released under the MIT License.

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago