• English
  • Trailing fade

    shad gradually reveals the trailing text with a moving gradient. Content already displayed stays unchanged, while the last few characters become visible as the stream advances.

    Trailing fade

    Usage

    Choose your framework above each example. Pass the Core example’s mappers to the Core inputs to enable the mappers explicitly. Components enable the same effects through streaming.effect and include their visual renderers.

    import type { MapperPluggable } from '@fluxdown/core';
    import { Smooth } from '@fluxdown/core-plugins/plugins/mapper/smooth';
    import { Shad } from '@fluxdown/core-plugins/plugins/mapper/shad';
    
    const mappers: MapperPluggable[] = [
      [Smooth, { enabled: true }],
      [Shad, { enabled: true }],
    ];

    Smoothing is enabled by default. Adjust the tail length and mask width to match your typography:

    import type { MapperPluggable } from '@fluxdown/core';
    import { Smooth } from '@fluxdown/core-plugins/plugins/mapper/smooth';
    import { Shad } from '@fluxdown/core-plugins/plugins/mapper/shad';
    
    const mappers: MapperPluggable[] = [
      [Smooth, { enabled: true }],
      [Shad, { enabled: true, length: 3, maskWidth: 18 }],
    ];

    Configuration

    These fields belong to the shad configuration object in ['shad', config].

    enabled Optional

    Type: boolean

    Default: true

    Enable the trailing fade.

    length Optional

    Type: number

    Default: 10

    Number of trailing characters included in the fade. Fractions round down; negative and non-finite values become 0.

    maskWidth Optional

    Type: number

    Default: 15

    Fade mask width in pixels. 0 hides the mask, negative values become 0, and non-finite values use the default width.