BloksMoleculeBackground

Background

Description

The Background component is a versatile and dynamic element that allows you to add visually appealing animated backgrounds to your web pages. It offers a selection of eight different effects, each providing a unique aesthetic to enhance the visual appeal of your content.

Installation

bash
sabaccui add background

Usage

Here are examples of how to use the Background component with different effects:

Bubbles Effect

Preview

Glimmer Effect

Preview

Lightspeed Effect

Preview

Meteors Effect

Preview

Network Effect

Preview

Particles Effect

Preview

Starfield Effect

Preview

Schema

Field NameTypeDescriptionDefault Value
effectoptionThe visual effect to be displayed as the background.No default (Required)
  • effect:
    • Type: option
    • Description: Determines the visual effect for the background. Must be one of the predefined options.
    • Options:
      • bubbles: Animated bubble effect
      • glimmer: Glimmering pixel effect
      • lightspeed: Light speed travel effect
      • meteors: Meteor shower effect
      • network: Network connection effect
      • particles: Particle system effect
      • starfield: Starfield effect

Notes

  1. The component dynamically renders the selected effect using Vue's dynamic component feature.
  2. Each effect is implemented as a separate component, allowing for modular development and easy maintenance.
  3. The component uses TypeScript for improved type safety and developer experience.

Best Practices:

  • Choose an effect that complements your content without overshadowing it.
  • Consider the performance impact of complex effects on slower devices.
  • Ensure sufficient contrast between the background effect and your content for readability.
  • Test the background effect across different screen sizes to ensure a consistent user experience.