{
  "name": "TextReveal",
  "category": "Motion",
  "subcategory": null,
  "description": "Word-by-word reveal animation on scroll.",
  "thumbnail": "/preview-cards/text-reveal.png",
  "hasDocsPage": true,
  "nugetPackage": "Lumeo.Motion",
  "files": [
    "UI/TextReveal/TextReveal.razor"
  ],
  "dependencies": [],
  "packageDependencies": [],
  "cssVars": [
    "--color-foreground"
  ],
  "api": {
    "name": "TextReveal",
    "category": "Motion",
    "subcategory": null,
    "description": "Word-by-word reveal animation on scroll.",
    "nugetPackage": "Lumeo.Motion",
    "files": [
      "UI/TextReveal/TextReveal.razor"
    ],
    "namespace": "Lumeo",
    "inheritsFrom": null,
    "implements": [
      "IAsyncDisposable"
    ],
    "parameters": [
      {
        "name": "Text",
        "type": "string",
        "default": "string.Empty",
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Stagger",
        "type": "int",
        "default": "80",
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Threshold",
        "type": "double",
        "default": "0.3",
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Class",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "AdditionalAttributes",
        "type": "Dictionary<string, object>?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": true
      }
    ],
    "events": [],
    "enums": [],
    "records": [],
    "cssVars": [
      "--color-foreground"
    ],
    "examples": [
      {
        "title": "Default Reveal",
        "code": "<TextReveal Text=\"Build beautiful Blazor UIs faster than ever before.\" Class=\"text-2xl font-semibold\" />"
      },
      {
        "title": "Fast Stagger",
        "code": "<TextReveal Text=\"Every word fades in at lightning speed with Stagger set to 40ms.\" Stagger=\"40\" Class=\"text-xl font-medium\" />"
      },
      {
        "title": "Slow Stagger",
        "code": "<TextReveal Text=\"Each word takes its time revealing the message one by one.\" Stagger=\"180\" Class=\"text-xl font-medium\" />"
      },
      {
        "title": "Hero Heading",
        "code": "<TextReveal Text=\"The Blazor component library designed for modern applications.\"\n             Class=\"text-3xl font-bold leading-tight\" Stagger=\"80\" />"
      }
    ],
    "subComponents": {},
    "parseFailed": false,
    "parseError": null
  },
  "$schema": "https://lumeo.nativ.sh/registry-component-schema.json",
  "key": "text-reveal",
  "docsUrl": "https://lumeo.nativ.sh/components/text-reveal",
  "sourceUrl": [
    {
      "file": "UI/TextReveal/TextReveal.razor",
      "url": "https://github.com/Brain2k-0005/Lumeo/tree/master/src/Lumeo.Motion/UI/TextReveal/TextReveal.razor"
    }
  ],
  "source": [
    {
      "path": "UI/TextReveal/TextReveal.razor",
      "content": "@namespace Lumeo\n@implements IAsyncDisposable\n@inject ComponentInteropService Interop\n\n<span id=\"@_elementId\" class=\"@CssClass\" @attributes=\"AdditionalAttributes\">\n    @for (var i = 0; i < _words.Length; i++)\n    {\n        <span data-motion-word>@_words[i]</span>\n        @if (i < _words.Length - 1)\n        {\n            @(\" \")\n        }\n    }\n</span>\n\n@code {\n    [Parameter] public string Text { get; set; } = string.Empty;\n    [Parameter] public int Stagger { get; set; } = 80;\n    [Parameter] public double Threshold { get; set; } = 0.3;\n    [Parameter] public string? Class { get; set; }\n    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }\n\n    private readonly string _elementId = $\"lumeo-reveal-{Guid.NewGuid():N}\";\n    private string[] _words = Array.Empty<string>();\n    private bool _registered;\n\n    private string CssClass => string.Join(\" \", new[] { \"lumeo-reveal\", Class }.Where(s => !string.IsNullOrWhiteSpace(s)));\n\n    protected override void OnParametersSet()\n    {\n        _words = string.IsNullOrEmpty(Text)\n            ? Array.Empty<string>()\n            : Text.Split(' ', StringSplitOptions.RemoveEmptyEntries);\n    }\n\n    protected override async Task OnAfterRenderAsync(bool firstRender)\n    {\n        if (firstRender && !_registered)\n        {\n            _registered = true;\n            try\n            {\n                await Interop.MotionRevealText(_elementId, Stagger, Threshold);\n            }\n            catch (JSDisconnectedException) { }\n        }\n    }\n\n    public async ValueTask DisposeAsync()\n    {\n        if (_registered)\n        {\n            await Interop.MotionDisposeObserver(_elementId);\n        }\n    }\n}\n"
    }
  ],
  "slots": [],
  "serviceDependencies": [
    {
      "service": "ComponentInteropService",
      "namespace": ""
    }
  ],
  "cascadingDependencies": [],
  "relatedComponents": [],
  "keyboardInteractions": [],
  "tests": [
    "tests/Lumeo.Tests/Components/TextReveal/TextRevealTests.cs"
  ],
  "mdSummary": "# TextReveal\n\nWord-by-word reveal animation on scroll.\n\n**Package:** `Lumeo.Motion` · **Category:** Motion\n**Docs:** https://lumeo.nativ.sh/components/text-reveal\n\n## Parameters\n| Owner | Name | Type | Default | Description |\n|---|---|---|---|---|\n| TextReveal | Text | `string` | `string.Empty` |  |\n| TextReveal | Stagger | `int` | `80` |  |\n| TextReveal | Threshold | `double` | `0.3` |  |\n| TextReveal | Class | `string?` | `` |  |\n| TextReveal | AdditionalAttributes | `Dictionary<string, object>?` | `` |  |\n\n## Slots\n- (none)\n\n## Events\n- (none)\n\n## Sub-components\n- (none)\n\n## Cascading values it expects\n- (none)\n\n## Services it injects\n- `ComponentInteropService` ()\n\n## Keyboard\n—\n\n## Example\n```razor\n<TextReveal />\n```\n\n## CSS variables\n`--color-foreground`\n\n## Files\n- `UI/TextReveal/TextReveal.razor`\n"
}