Git Product home page Git Product logo

openclassrooms-14-react-dialog's Introduction

oc-14-react-dialog

Caution

This repository hosts a project completed as part of my OpenClassrooms training program. Having successfully completed the program, the project has now been archived and will no longer be actively maintained. Please be aware that while the repository will remain accessible for reference, some links or features may no longer function as intended.

Preview

Project Overview

In this project, I was required to select and convert a plugin from this project to React. I opted to recreate a dialog plugin.

Useful Links

Details

This dialog, along with its variants, is built on top of the Radix Dialog and Radix Alert Dialog primitives to ensure accessibility. For styling, I've used Tailwind CSS.

Installation

pnpm install @oc-wh/react-dialog

Components

Alert Dialog

An interruptive modal dialog presenting important content and expecting a user response.

  1. Imports

    import {
      AlertDialog,
      AlertDialogAction,
      AlertDialogCancel,
      AlertDialogContent,
      AlertDialogDescription,
      AlertDialogFooter,
      AlertDialogHeader,
      AlertDialogTitle,
      AlertDialogTrigger,
    } from '@oc-wh/react-dialog'
  2. Anatomy

    <AlertDialog>
      <AlertDialogTrigger></AlertDialogTrigger>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle></AlertDialogTitle>
          <AlertDialogDescription></AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel></AlertDialogCancel>
          <AlertDialogAction></AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>

Dialog

A window overlaying either the primary window or another dialog window, rendering the underlying content inactive.

  1. Imports

    import {
      Dialog,
      DialogContent,
      DialogDescription,
      DialogHeader,
      DialogTitle,
      DialogTrigger,
    } from '@oc-wh/react-dialog'
  2. Anatomy

    <Dialog>
      <DialogTrigger></DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle></DialogTitle>
          <DialogDescription></DialogDescription>
        </DialogHeader>
      </DialogContent>
    </Dialog>

Sheet

An extension of the Dialog component, displaying complementary content to the main content of the screen.

  1. Imports

    import {
      Sheet,
      SheetContent,
      SheetDescription,
      SheetHeader,
      SheetTitle,
      SheetTrigger,
    } from '@oc-wh/react-dialog'
  2. Anatomy

    <Sheet>
      <SheetTrigger></SheetTrigger>
      <SheetContent>
        <SheetHeader>
          <SheetTitle></SheetTitle>
          <SheetDescription></SheetDescription>
        </SheetHeader>
      </SheetContent>
    </Sheet>

Side Property

Use the side property on the <SheetContent /> to specify the screen edge where the component will appear. Acceptable values are top, right, bottom, or left.

Customization

All components are fully customizable with the className property. When using Tailwind CSS, the plugin employs clsx and Tailwind merge. This allows you to use all the Tailwind CSS classes without bloating your bundle size.

License

This project is licensed under the MIT License. For more details, see the LICENSE file.

openclassrooms-14-react-dialog's People

Contributors

alexperronnet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.