npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-card-carousel-materialui

v0.3.1

Published

A full-screen card carousel designed in Material UI, drawing inspiration from the Tesla website.

Downloads

9

Readme

React Card Carousel - Material UI v5

A full-screen card carousel designed in Material UI, drawing inspiration from the Tesla website.

Demo

This package supports both desktop and mobile devices. It behaves differently in both the devices.

Component Preview

productionimage

Component in action

productionvideo

Installation

React Card Carousel requires Node.js v10+ to run.

npm i react-card-carousel-materialui@latest

Usage

Import Component

Import the component in your project

import { CardCarousel } from "react-card-carousel-materialui"
Add Component

Add the component in your project

<CardCarousel
  open={open}
  onClose={onClose}
  items={items}
/>

Basic Example

import { useState } from 'react';
import { CardCarousel } from "react-card-carousel-materialui";
import './App.css';

function App() {

    const [dialogOpen, setDialogOpen] = useState(false);

    return (
        <div className="App">
            {
                dialogOpen &&
                <CardCarousel
                    open={dialogOpen}
                    onClose={() => { setDialogOpen(!dialogOpen) }}
                    items={items}
                />
            }
            <button variant="contained" onClick={() => { setDialogOpen(!dialogOpen) }} style={{
                position: 'absolute',
                top: '50%',
                left: '50%',
                transform: 'translate(-50%, -50%)',
                zIndex: 1,
                width: '100px',
                height: '50px',
            }}>
                Open Dialog
            </button>
        </div>
    );
}

export default App;

Items

[
    {
        id: "1",
        title: 'Wall Connector',
        description: `Our recommended home charging solution.

                        With charging speeds up to 44 miles of range added per hour depending on vehicle model, a versatile indoor/outdoor design and a 24 foot cable, the Wall Connector is our quickest, most convenient way to charge at home.
                        
                        Installation required and not included.`,
        image: 'https://digitalassets-shop.tesla.com/image/upload/f_auto,q_auto/v1/content/dam/tesla/studio/CAR_ACCESSORIES/MODEL_S/CHARGING_ADAPTERS/1457768-01-F_0_2000.jpg?'
    },
    {
        id: "2",
        title: 'Auto Lane Change',
        description: 'While driving on the highway, Automatic Lane Change will position your car in the optimal lane to prepare for merges and exits while overtaking slow cars. Drivers are given clear insight to upcoming lane changes as well as customization to Auto Lane Change functionality.',
        image: 'https://via.placeholder.com/900x500',
        video: 'https://digitalassets.tesla.com/co1n/video/upload/f_auto:video,q_auto:best/prod/static_assets/MODEL3/UI/lane_change.mp4',
        actions: (
            <Box>
                <Box lineHeight={0} mb={2}>
                    <Stack direction="column" spacing={0} justifyContent="center" alignItems="center">
                        <Typography variant="body2" fontWeight="medium" >
                            Enhanced Autopilot
                        </Typography>
                        <Typography variant="body2" fontWeight="medium" >
                            ₹ 60,000
                        </Typography>
                    </Stack>
                </Box>
                <Button variant="contained" color="info" fullWidth startIcon={<ShoppingCart />}>
                    Add Package
                </Button>
            </Box>
        )
    },
    {
        id: "3",
        title: 'Smart Summon',
        description: 'Activated by the Tesla App, your parked car will come find you and even park or unpark itself in tight spaces. Summon navigates complex parking situations while abiding by lane markings and stop signs, avoiding pedestrians and obstacles like traffic cones, trash bins and rogue shopping carts.',
        image: 'https://via.placeholder.com/900x500',
        video: 'https://digitalassets.tesla.com/co1n/video/upload/f_auto:video,q_auto:best/prod/static_assets/MODEL3/UI/summon_v2.mp4',
        actions: (
            <Box>
                <Box lineHeight={0} mb={2}>
                    <Stack direction="column" spacing={0} justifyContent="center" alignItems="center">
                        <Typography variant="body2" fontWeight="medium" >
                            Enhanced Autopilot
                        </Typography>
                        <Typography variant="body2" fontWeight="medium" >
                            ₹ 60,000
                        </Typography>
                    </Stack>
                </Box>
                <Button variant="contained" color="info" fullWidth startIcon={<ShoppingCart />}>
                    Add Package
                </Button>
            </Box>
        )
    },
    {
        id: "4",
        title: 'Traffic Light and Stop Sign Control',
        description: `Traffic Light and Stop Sign Control is designed to slowdown and stop for visible traffic lights or stop signs that are detected when Traffic-Aware Cruise Control or Autosteer is engaged.`,
        image: 'https://digitalassets.tesla.com/co1n/image/upload/f_auto,q_auto/prod/static_assets/MODEL3/UI/Traffic_Light_and_Stop_Sign.png?',
        actions: (
            <Box>
                <Box lineHeight={0} mb={2}>
                    <Stack direction="column" spacing={0} justifyContent="center" alignItems="center">
                        <Typography variant="body2" fontWeight="medium" >
                            Full Self-Driving Capability
                        </Typography>
                        <Typography variant="body2" fontWeight="medium" >
                            ₹ 120,000
                        </Typography>
                    </Stack>
                </Box>
                <Button variant="contained" color="info" fullWidth startIcon={<ShoppingCart />}>
                    Add Package
                </Button>
            </Box>
        )
    },
    {
        id: "5",
        title: 'Full Self-Driving Computer',
        description: `Tesla-designed silicon optimized for computer vision enables detailed, onscreen environment visualization and eventual Full Self-Driving Capability through over-the-air software updates.`,
        image: 'https://digitalassets.tesla.com/co1n/image/upload/f_auto,q_auto/prod/static_assets/MODEL3/UI/FSDComputer.png?',
        actions: (
            <Box>
                <Box lineHeight={0} mb={2}>
                    <Stack direction="column" spacing={0} justifyContent="center" alignItems="center">
                        <Typography variant="body2" fontWeight="medium" >
                            Full Self-Driving Capability
                        </Typography>
                        <Typography variant="body2" fontWeight="medium" >
                            ₹ 120,000
                        </Typography>
                    </Stack>
                </Box>
                <Button variant="contained" color="info" fullWidth startIcon={<ShoppingCart />}>
                    Add Package
                </Button>
            </Box>
        )
    }
]

Props

| Prop | Type | Default | Description | Required | | ------ | ------ | ------ | ------ | ------ | | open | boolean | false | control dialog open and close | Yes | | onClose | function | | Function called whenever dialog is closed | Yes | | items | array | [] | Array of items to be shown in the dialog | Yes |

Item Props

| Prop | Type | Default | Description | Required | | ------ | ------ | ------ | ------ | ------ | | id | string | | Unique ID for item | Yes | | title | string | | Title for item | Yes | | description | string | | Description for item | No | | image | string(url) | | Image shown for the item | No | | video | string(url) | | Video shown for the item | No | | actions | node | | Any custom UI to be shown below the description | No |

Upcoming Features

Below are the features that are planned to be added in the near future.

  • [ ] Add support for custom UI in Card items
  • [ ] Add support for slider animations

License

MIT

This is a free software: you can redistribute it and/or modify it under the terms of the MIT license. This software is provided without any warranty.