Coder Social home page Coder Social logo

ssetto's Introduction

Ssetto is an unstyled drawer component with a sheet animation for Solid. It is based on top of corvu

Usage

To start using the library, install it in your project:,

npm install ssetto

Use the drawer in your app.

import  Drawer  from 'ssetto';

function MyComponent() {
  return (
    <Drawer.Root  bgSelector={document.querySelector('#app') as HTMLElement}>
        <Drawer.Trigger class="rounded-lg bg-stone-100 px-4 py-3 text-lg font-medium text-stone-600 transition-all duration-100 hover:bg-stone-200 active:translate-y-0.5">
          Open Drawer
        </Drawer.Trigger>
        <Drawer.Portal>
          <Drawer.Overlay  />
          <Drawer.Content class="max-h-[90vh] bg-stone-50 border-none" >
            <div class="h-1 w-10 self-center rounded-full bg-stone-300" />
            <Drawer.Label class="mt-2 text-center text-xl font-bold">
              I'm a drawer!
            </Drawer.Label>
            <Drawer.Description class="mt-1 text-center">
              Drag down to close me.
            </Drawer.Description>
            <p class="absolute inset-x-0 -bottom-5 z-10 text-center bg-inherit">
              ๐Ÿธ You found froggy!
            </p>
          </Drawer.Content>
        </Drawer.Portal>
      </Drawer.Root>
  );
}

API Reference

The Root, Overlay and the Content components are wrappers around Corvu's ones.

The rest of components are exported from Corvu's ones

Docs.

Root

bgSelector: background element to apply the animation. type HTMLElement.

Trigger

The button that opens the dialog. Docs.

Content

class: class to style the element.

ssetto's People

Contributors

riccardoeudizi avatar

Watchers

Paimon avatar  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.