Wraps a card, button, or field in a moving gradient border that spins, shines, or pulses, with an optional soft glow.
Pro workspace
Unlimited projects, priority support, and advanced analytics.
$24 / month
Pro workspace
Unlimited projects, priority support, and advanced analytics.
$24 / month
Pro workspace
Unlimited projects, priority support, and advanced analytics.
$24 / month
Pro workspace
Unlimited projects, priority support, and advanced analytics.
$24/ month
Pro workspace
Unlimited projects, priority support, and advanced analytics.
$24 / month
<x-markas.gradient-border class="mx-auto max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<p class="text-sm text-muted">
Unlimited projects, priority support, and advanced analytics.
</p>
<p class="text-3xl font-bold text-ink">
$24<span class="text-sm font-normal text-muted"> / month</span>
</p>
<x-markas.button>Upgrade now</x-markas.button>
</div>
</x-markas.gradient-border>Examples
Shining buttons
Featured plan with glow
Starter
$0
For side projects.
Team
$49
Most popular.
Starter
$0
For side projects.
Team
$49
Most popular.
Starter
$0
For side projects.
Team
$49
Most popular.
Starter
$0
For side projects.
Team
$49
Most popular.
Starter
$0
For side projects.
Team
$49
Most popular.
AI prompt field
<div class="p-6">
<x-markas.gradient-border radius="lg" speed="slow" :glow="true">
<label class="grid gap-1 p-3">
<span class="text-sm font-medium text-ink">Ask the assistant</span>
<input
type="text"
placeholder="Summarize last week's tickets"
class="h-9 rounded-md bg-surface text-sm text-ink placeholder:text-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
/>
</label>
</x-markas.gradient-border>
</div>Installation
npx markasui@latest add gradient-borderpnpm dlx markasui@latest add gradient-borderyarn dlx markasui@latest add gradient-borderbunx --bun markasui@latest add gradient-border- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/gradient-border.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/GradientBorder.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/GradientBorder.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/GradientBorder.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/GradientBorder.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/gradient-border.component.ts.
Usage
<x-markas.gradient-border variant="spin" :glow="true" class="max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<x-markas.button>Upgrade now</x-markas.button>
</div>
</x-markas.gradient-border>No JavaScript or Alpine.js needed.
import { GradientBorder } from "@/components/markas/GradientBorder";
<GradientBorder variant="spin" glow className="max-w-80">
<div className="grid gap-3 p-6">
<h3 className="text-lg font-semibold text-ink">Pro workspace</h3>
<Button>Upgrade now</Button>
</div>
</GradientBorder>;<template>
<GradientBorder variant="spin" glow class="max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<Button>Upgrade now</Button>
</div>
</GradientBorder>
</template><script lang="ts">
import Button from "$lib/components/markas/Button.svelte";
import GradientBorder from "$lib/components/markas/GradientBorder.svelte";
</script>
<GradientBorder variant="spin" glow class="max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<Button>Upgrade now</Button>
</div>
</GradientBorder>---
import Button from "@/components/markas/Button.astro";
import GradientBorder from "@/components/markas/GradientBorder.astro";
---
<GradientBorder variant="spin" glow class="max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<Button>Upgrade now</Button>
</div>
</GradientBorder>No client-side JavaScript; the markup is rendered on the server.
import { Component } from "@angular/core";
import { Button } from "./markas/button.component";
import { GradientBorder } from "./markas/gradient-border.component";
@Component({
selector: "app-hero",
imports: [Button, GradientBorder],
template: `
<div markas-gradient-border variant="spin" glow class="max-w-80">
<div class="grid gap-3 p-6">
<h3 class="text-lg font-semibold text-ink">Pro workspace</h3>
<button markas-button>Upgrade now</button>
</div>
</div>
`,
})
export class Hero {}The component is an attribute on a div, so class, style, and other attributes stay on the root element.
- The border is 1px. Put padding on the content inside; the inner panel uses
bg-surface. - For a pill button use
radius="full"withinline-blockon the component androunded-fullon the button. spinuses container query units, supported by every current browser.- The component has no built-in text, so there are no label props to translate.
Props
| Name | Type | Default | Description |
|---|---|---|---|
variant | spin | shine | pulse | spin | spin rotates a conic gradient around the edge, shine sweeps a glint across, pulse breathes the whole border. |
color | muted | primary | success | warning | danger | primary | Token color of the gradient. |
speed | slow | normal | fast | normal | Length of one cycle: 8s, 4s, or 2s. |
radius | lg | xl | full | xl | Corner radius of the border and the inner surface. |
glow | boolean | false | Adds a soft blurred copy of the gradient behind the border. |
children / slot | slot / ReactNode / snippet | - | Content inside the border, on a bg-surface panel. |
Accessibility
- The gradient layers are aria-hidden and ignore pointer events.
- With reduced motion, the gradient stays still in a fixed position.
- Focus styles of the content inside are not covered by the border.
Related components
More backgrounds components with the same classes in every framework.
- Aurora BackgroundSoft glowing color fields that drift slowly behind your content, made from primary and an accent token.
- Background BeamsThin curved light beams that flow, pulse, or fall and splash behind your content. Pure SVG and CSS, no JavaScript.
- Background BoxesA skewed, flat, or perspective grid of tiles that light up under the cursor and fade back, using only CSS hover.
- Background LinesSVG lines that draw in and fade out one after another, as waves, rays from a point, or a lattice. Made for hero sections.
- Dot PatternA grid of small dots behind your content, with an optional radial or linear fade. Pure CSS, no JavaScript.
- Grid PatternThin grid lines behind your content, with highlighted cells that pulse softly and an optional fade.