Skip to content

e280/shiny

Repository files navigation

✨shiny✨

web ui components



🍭 instant html installation

  • put this in your html <head>
    <script async src="https://shiny.e280.org/install/aura.bundle.min.js"></script>
    • you can swap aura there for another theme
  • you're ready to put shiny components in your html <body>
    <shiny-copy text="hello world"></shiny-copy>
  • go pick your favorites at https://shiny.e280.org/



🍬 web app installation

  • install shiny and friends
    npm install @e280/shiny @e280/sly lit
  • import stuff
    import {dom} from "@e280/sly"
    import {shiny, themes} from "@e280/shiny"
  • prepare the components/views and choose a theme
    const {components, views} = shiny({theme: themes.aura})
  • (optional) register the components
    dom.register(components)
    • or use views instead of components
  • go shopping at https://shiny.e280.org/



🎨 themes

  • aura — cosmic dreamy seaside nebula vibes
  • plain — bare-bones spartan theme, for diy, buttons look lame



😎 views are for the cool kids

  • hey, remember those views you got from the web app install snippet?
  • well you can yoink out a view you wanna use
    const {ShinyCopy} = views
  • then you can use 'em directly in your lit templates
    import {html} from "lit"
    import {dom, view} from "@e280/sly"
    
    dom.register({
      MyComponent: view.component(use => html`
        <div>
          ${ShinyCopy("hello world")}
        </div>
      `)
    })
    • you get nice typescript typings
    • no juggling annoying web component dom registrations
    • you're just using the shiny views directly
    • learn more about 🦝sly and 🔥lit



💅 page-wide css customization

  • put this in your <head> and you can customize colors and stuff
    <style>
      html {
        --shiny-bg: #111;
        --shiny-alpha: #def;
        --shiny-lame: #8888;
        --shiny-inactive-opacity: 0.5;
        --shiny-angry: #f50;
        --shiny-zesty: #cf0;
        --shiny-happy: #0fa;
        --shiny-calm: #0af;
        --shiny-sad: #74f;
        --shiny-quirky: #f49;
      }
    </style>



🧑‍💻 by e280

reward us with github stars
build with us at https://e280.org/ if you're good at dev