Zubra UI
Code for
GitHub

shine-border

A frame with a beam of light travelling around its border, in the theme's chart colours, for the plan or feature you want noticed. Decorative, and still under reduced motion.

Team plan

Unlimited projects and five seats, $12 a month.

This one has no events: it shows what it's given.

Source: shine-border.zb, and its registry item.

Install

Compiled (any project)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/shine-border.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/shine-border.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/shine-border.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/shine-border.json
One file, no dependencies (3.3 KB gzipped)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/shine-border.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/shine-border.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/shine-border.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/shine-border.json
.zb source (to edit it with Zubra)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/shine-border.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/shine-border.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/shine-border.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/shine-border.json
No build: a script tag, straight from this site
HTML
<link rel="stylesheet" href="https://zubra-js.github.io/zubra-ui/themes/default.css">
<script type="module" src="https://zubra-js.github.io/zubra-ui/cdn/shine-border.js"></script>

The compiled install writes src/components/zubra/shine-border.js and the theme, and adds @zubra/runtime to your dependencies. The one-file install writes the same path as a plain custom element that needs nothing installed (or download it and load it with a <script type="module">); it's smaller on a page with one to three components, the shared runtime with more.

Usage

index.html
<shine-border>
  <div class="demo-hero">
    <h2>Team plan</h2>
    <p>Unlimited projects and five seats, $12 a month.</p>
  </div>
</shine-border>

<script type="module">
  import './components/zubra/shine-border.js';

  const element = document.querySelector('shine-border');
  element.duration = 6;
</script>
Example.jsx
import './components/zubra/shine-border.js';

const duration = 6;

export function ShineBorderExample() {
  return (
    <shine-border duration={duration}>
      <div className="demo-hero">
        <h2>Team plan</h2>
        <p>Unlimited projects and five seats, $12 a month.</p>
      </div>
    </shine-border>
  );
}
Example.vue
<script setup>
import './components/zubra/shine-border.js';
const duration = 6;
</script>

<template>
  <shine-border :duration.prop="duration">
    <div class="demo-hero">
      <h2>Team plan</h2>
      <p>Unlimited projects and five seats, $12 a month.</p>
    </div>
  </shine-border>
</template>

<!-- vite.config.js: vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.includes('-') } } }) -->
Example.svelte
<script>
  import './components/zubra/shine-border.js';
  const duration = 6;
</script>

<shine-border {duration}>
  <div class="demo-hero">
    <h2>Team plan</h2>
    <p>Unlimited projects and five seats, $12 a month.</p>
  </div>
</shine-border>
example.component.ts
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import './components/zubra/shine-border.js';

@Component({
  selector: 'app-shine-border-example',
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <shine-border [duration]="duration">
      <div class="demo-hero">
        <h2>Team plan</h2>
        <p>Unlimited projects and five seats, $12 a month.</p>
      </div>
    </shine-border>
  `,
})
export class ShineBorderExample {
  duration = 6;
}

API

Properties (each is also an HTML attribute of the same name, unless marked)
PropertyTypeDefault
durationnumber6
widthstring"1.5px"
Slots
SlotFor
(default)What the frame holds.

Size

0.8 KB gzipped for the component, plus the runtime, which every Zubra component on a page shares (up to 22.1 KB, all of it). On its own, with the parts of the runtime it uses, it's 17.0 KB.

Theme

Every component reads shadcn/ui's CSS variables, so any shadcn theme works. Pick a look or a colour, or paste a theme's CSS.

Look: colours, fonts, corners and motion

Accent colour