Code Monkey home page Code Monkey logo

supabase-web-components's Introduction

Supabase Web Components

A set of simple, build-less, framework-agnostic, plain vanilla js web components to get quickly up and running with a Supabase frontend.

Demo

https://narve.github.io/supabase-web-components/

Usage

    ...
<head>
    ...
    <!-- Not necessary but a class-less stylesheet works nicely with these components ->
    <link rel="stylesheet" type="text/css" href="https://unpkg.com/chimeracss/build/chimera.css"/>

    <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>
    <script>
        const supabaseUrl = 'https://xupzhicrqmyvtgztrmjb.supabase.co'
        const supabaseKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMDExNjg5NCwiZXhwIjoxOTI1NjkyODk0fQ.cvK8Il2IbFqU03Q4uOhSQ9jxFkWELLACX7mJKyy_Ue0"
        const client = supabase.createClient(supabaseUrl, supabaseKey)
    </script>

    <script  type="module" src="https://cdn.jsdelivr.net/gh/narve/supabase-web-components/src/supabase-index.js"></script>
</head>
<body>
<supabase-index></supabase-index>
...

Style

SWC are by default not using shadow-dom, so your standard CSS should work as expected also on the elements created by SWC.

To enable shadow-dom, you can use the shadow attribute on the custom element:

<supabase-table shadow> source="my_table"</supabase-table>

If shadow-root is enabled, global styles will not affect the elements within the components.

All components expose a part attribute that can be used to style the internal elements.

supabase-table::part(container) {
  background-color: #f0f0f0;
}

supabase-web-components's People

Contributors

narve 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.