#

#

SC Gradient Border

SC Gradient Border

SC Gradient Border

Sep 1, 2025

0 views

A pure-CSS gradient border wrapper for Framer. Uses layered masks to “punch out” the center, leaving a crisp, GPU-friendly gradient ring around your content area. Fully configurable via color stops, angle, width, and radius.

Lilac Flower
Lilac Flower
Lilac Flower
Lilac Flower
#
Built With
React, CSS (gradients + masks), Framer Code Component API
#
Layout Support
Fully Responsive (fills parent)
#
Orientation
N/A
#
Ideal Use Case
Cards, avatars, badges, containers needing premium gradient accents
#
Built With
React, CSS (gradients + masks), Framer Code Component API
#
Layout Support
Fully Responsive (fills parent)
#
Orientation
N/A
#
Ideal Use Case
Cards, avatars, badges, containers needing premium gradient accents
#
Built With
React, CSS (gradients + masks), Framer Code Component API
#
Layout Support
Fully Responsive (fills parent)
#
Orientation
N/A
#
Ideal Use Case
Cards, avatars, badges, containers needing premium gradient accents

//

Tags

gradient
border
mask
css
ui
//
Technologies
None (pure CSS + React)
//
Notes
No external libs; relies on -webkit-mask-composite: xor + mask-composite: exclude layering.
//
Technologies
None (pure CSS + React)
//
Notes
No external libs; relies on -webkit-mask-composite: xor + mask-composite: exclude layering.
//
Technologies
None (pure CSS + React)
//
Notes
No external libs; relies on -webkit-mask-composite: xor + mask-composite: exclude layering.
#
Logic Level
Low (map gradient stops → CSS string)
#
Runtime Cost
Very Low (static styles; no loops/RAF)
#
Component Size
~1–2 KB TSX
#
Notes
GPU-accelerated by browsers; no layout thrash when props change.
#
Logic Level
Low (map gradient stops → CSS string)
#
Runtime Cost
Very Low (static styles; no loops/RAF)
#
Component Size
~1–2 KB TSX
#
Notes
GPU-accelerated by browsers; no layout thrash when props change.
#
Logic Level
Low (map gradient stops → CSS string)
#
Runtime Cost
Very Low (static styles; no loops/RAF)
#
Component Size
~1–2 KB TSX
#
Notes
GPU-accelerated by browsers; no layout thrash when props change.
  1. Add to your Framer project and place on the canvas.

  2. Set Colors (array of { color, position% }) to define the gradient.

  3. Adjust Angle (0–360°), Border Width (px), and Radius (px).

  4. Place content inside the component frame (the inner white panel).

  5. For dark themes, change the inner panel color in code if needed.

  • Preset A (Subtle Duo): stops=[{#ff00cc,0},{#3333ff,100}], angle=45, width=4, radius=12

  • Preset B (Rainbow Ring): stops=[red,orange,yellow,green,blue,indigo,violet @ spaced 0–100], angle=90, width=6, radius=20

  • Preset C (Mono Glow): stops=[{#0ea5e9,0},{#22d3ee,100}], angle=135, width=2, radius=8

  • Gradient string from stops[] → linear-gradient(angle, color position, …).

  • Outer wrapper gets padding = borderWidth and the gradient background.

  • Two mask layers (content-box + full box) with xor/exclude create a hollow center, so only the border area shows the gradient.

  • Inner child fills remaining space as the actual content surface.

  • Prefer 2–4 color stops for minimal paint; more is fine for hero elements.

  • Gradients are cheap; large radii and wide borders are safe.

  • Avoid animating borderRadius or borderWidth every frame; prefer discrete transitions.

  • Modern Chromium/WebKit support -webkit-mask-composite: xor; mask-composite: exclude used as a standard fallback.

  • Firefox support for the exact composite semantics may vary; if you target older/strict Firefox environments, consider an SVG fallback.

  • Inner panel is hardcoded to white; change to a tokenized var if theming is required.

  • Decorative effect; set aria-hidden="true" on the wrapper if used purely as chrome.

  • Ensure inner content maintains sufficient contrast against the inner panel color.

  • No network calls; no storage.

  • No dangerouslySetInnerHTML / eval.

  • No device permissions.

  • Cleans up by default (no timers/listeners created).

Name

Type

Default

Description

stops

Array<{ color:string; position:number(0–100) }>

[{ "#ff00cc",0 }, { "#3333ff",100 }]

Gradient color stops with percentage positions.

angle

number(0–360)

45

Gradient angle in degrees.

borderWidth

number(px)

4

Thickness of the gradient ring (via wrapper padding).

borderRadius

number(px)

12

Corner rounding applied to outer and inner panels.

name:stops
type:Array<{ color:string; position:number(0–100) }>
default:[{ "#ff00cc",0 }, { "#3333ff",100 }]
desc:Gradient color stops with percentage positions.
name:angle
type:number(0–360)
default:45
desc:Gradient angle in degrees.
name:borderWidth
type:number(px)
default:4
desc:Thickness of the gradient ring (via wrapper padding).
name:borderRadius
type:number(px)
default:12
desc:Corner rounding applied to outer and inner panels.

Name

Type

Default

Description

name:stops
type:Array<{ color:string; position:number(0–100) }>
default:[{ "#ff00cc",0 }, { "#3333ff",100 }]
desc:Gradient color stops with percentage positions.
name:angle
type:number(0–360)
default:45
desc:Gradient angle in degrees.
name:borderWidth
type:number(px)
default:4
desc:Thickness of the gradient ring (via wrapper padding).
name:borderRadius
type:number(px)
default:12
desc:Corner rounding applied to outer and inner panels.
  • Decorative effect; set aria-hidden="true" on the wrapper if used purely as chrome.

  • Ensure inner content maintains sufficient contrast against the inner panel color.

  • No network calls; no storage.

  • No dangerouslySetInnerHTML / eval.

  • No device permissions.

  • Cleans up by default (no timers/listeners created).

  • Effect pattern inspired by CSS mask-composite techniques.

  • Implementation & Framer adaptation by SecretoCho Design.

SecretoCho Design 2025

Provided “as is” for visual/UX purposes. Validate cross-browser behavior, accessibility, and performance for your project.

Stay ahead of the curve with insights into emerging visualization trends and technologies.