Skip to content

TuiPanelZero

Star
🏅Original

TuiPanelZero is a lightweight pure CSS container within the TechUI Scifi Panel series.

It stands out in the series because, unlike the ScifiPanel family which relies on complex SVG/WASM path calculations, it is entirely rendered using native CSS (utilizing features like border, box-shadow, and pseudo-elements).

It offers extremely low rendering overhead. It is perfectly suited as a container for high-frequency rendering scenarios (such as large-scale list items) or for wrapping standard UI components that come with rounded corners (like input boxes or button groups), ensuring optimal browser performance while maintaining a high-tech appearance.

Tip: This component can be invoked via TuiPanelA1 or its semantic alias TuiPanelZero.

Basic Usage

Default Form

By default, TuiPanelZero appears as a rectangle with a subtle border and enhanced "L-shaped" angle bracket decorations at the four corners.

vue
<template>
  <div style="width: 100%; height: 200px;">
    <TuiPanelZero>
      <div class="content">
        Pure CSS rendering, high-performance container
      </div>
    </TuiPanelZero>
  </div>
</template>

Visual

Border Radius Settings

This is a unique feature of TuiPanelZero. Through borderRadius, you can freely control whether the panel has a sharp right-angle or a soft rounded corner.

  • Right-Angle (0): Close to the tough style of the ScifiPanelB series.
  • Rounded Corner (4px - 20px): Suitable for modern UI styles, ideal for wrapping cards or buttons.
vue
<template>
  <div class="grid">
    <TuiPanelZero :borderRadius="0">
      <div class="p-4">Square Mode</div>
    </TuiPanelZero>

    <TuiPanelZero :borderRadius="12">
      <div class="p-4">Round Mode</div>
    </TuiPanelZero>
  </div>
</template>

Angle Brackets Configuration

TuiPanelZero allows you to finely control the geometric shape of the four-corner "brackets." These properties map directly to CSS variables, making adjustments highly flexible.

  • angleLength: The length of the bracket arms (px).
  • angleWeight: The thickness of the bracket lines (px).
  • anglePosition: The offset distance of the bracket from the border (px). Negative values offset outward, while positive values offset inward.
vue
<template>
  <TuiPanelZero 
    :angleLength="20"
    :angleWeight="4" 
    :anglePosition="-2"
    :borderWidth="1"
  >
    <div class="p-4">Heavy Corners</div>
  </TuiPanelZero>
</template>

Minimalist & Glow (Glow & Minimal)

  • decoration: Controls the display of the four-corner brackets. When set to false, only the base border is retained.
  • borderd: Controls the display of the base thin border.
  • glow: Enables the CSS box-shadow glow effect.
vue
<template>
  <TuiPanelZero 
    :decoration="false" 
    :borderd="false"
    :glow="true"
    :glowRange="15"
    :backgroundOpacity="0.8"
  >
    <div class="neon-text">PURE GLOW</div>
  </TuiPanelZero>
</template>

CSS Variable

The color system for TuiPanelZero is very intuitive. You can override the corresponding --tui- variables via className.

TuiPanelZero exposes a very detailed CSS variable interface, allowing you not only to modify colors but also to directly control geometric properties (such as corner length and border radius) through CSS. This is particularly useful for responsive layouts when combined with media queries.

Case: Aurora Cyan Style

This case demonstrates how to define a style with strong glow and custom corner dimensions by overriding variables via a class name.

vue
<template>
  <TuiPanelZero 
    className="panel-aurora"
    :borderRadius="8"
    :glow="true"
  >
    <div class="info">CSS MODULE</div>
  </TuiPanelZero>
</template>

<style lang="less">
.panel-aurora {
  /* --- Color Definitions --- */
  --tui-panel-bd: #06b6d4;       /* Base thin border color */
  --tui-panel-hlite: #ffffff;    /* Four-corner bracket highlight color */
  --tui-panel-bg: rgba(8, 51, 68, 0.8); /* Background color */
  --tui-panel-shadow: rgba(34, 211, 238, 0.6); /* Glow/shadow base color */

  /* --- Geometric Fine-tuning (Optional, can also be passed via Props) --- */
  --tui-panel-angle-length: 20px; /* Lengthen corner brackets */
  --tui-panel-angle-weight: 3px;  /* Thicken corner brackets */
  --tui-panel-glow-range: 15px;   /* Expand glow range */
  --tui-panel-glow-op: 0.8;       /* Increase glow intensity */
}
</style>

API Reference

As it is a pure CSS component, some SVG-specific properties (such as title, rotate, and path related props) do not take effect in this component.

Props (Active List)

Prop NameDescriptionTypeDefault
borderRadiusBorder Radius. Controls the roundness of the cornersNumber2
borderRadiusFixRadius Correction. Fine-tunes the clipping of internal contentNumber0
angleLengthAngle Length. Controls the length of the corner bracketsNumber15
angleWeightAngle Weight. Controls the line width of the corner bracketsNumber2
anglePositionAngle Position. The offset of brackets from the edgeNumber-1
decorationWhether to show the corner bracket decorationsBooleantrue
borderdWhether to show the base thin borderBooleantrue
borderWidthWidth of the base borderNumber1
backgroundOpacityOpacity of the background color (0-1)Number1
backgroundBlurWhether to enable the background frosted glass effect (backdrop-filter)Booleanfalse
blurRangeFrosted glass blur radius (px)Number3
glowWhether to enable outer glowBooleanfalse
glowRangeOuter glow spread range (px)Number10
glowOpacityOuter glow opacityNumber0.5
classNameCustom container class nameString

CSS Variables

The following is the complete list of supported CSS variables for TuiPanelZero. You can override these variables at the component parent level or via className.

Variable NameDescriptionDefault / Dependency
--tui-panel-bdColor of the base thin bordervar(--scifi-bd)
--tui-panel-bdwWidth of the base thin border1px
--tui-panel-bgPanel background colorvar(--scifi-bg)
--tui-panel-bgopBackground opacity1
--tui-panel-bgblurBackground frosted glass blur radius3px
--tui-panel-hliteHighlight color of the corner bracketsvar(--scifi-hlite)
--tui-panel-angle-lengthArm length of the corner brackets15px
--tui-panel-angle-weightLine thickness of the corner brackets2px
--tui-panel-angle-positionOffset of brackets from edge (negative=out, positive=in)-1px
--tui-panel-bdraPanel border radius2px
--tui-panel-bdrafixRadius correction (for fine-tuning internal content clipping)0px
--tui-panel-shadowColor of the shadow or outer glowvar(--shadow-weak)
--tui-panel-glow-rangeSpread range of the outer glow (box-shadow)10px
--tui-panel-glow-opOpacity of the outer glow0.5
--tui-panel-focusFocus state color (if component supports focus)var(--scifi-focus)
--tui-panel-scaleOverall transform scale ratio

Released under the MIT License.