Docs Components Primitives

Reveal

React example follows below.
ts
const revealFixture = {
id: "reveal",
text: "Slides in once scrolled into view.",
} satisfies { id: string; text: string };
import { Reveal } from "@grassroot/ui-react";
export default function RevealDemo() {
return (
<div>
<Reveal>
<div className="rounded-xs border bg-card px-4 py-3">{revealFixture.text}</div>
</Reveal>
</div>
);
}
ts
<script setup lang="ts">
const revealFixture = {
id: "reveal",
text: "Slides in once scrolled into view.",
} satisfies { id: string; text: string };
import { Reveal } from "@grassroot/ui-vue";
</script>
<template>
<div>
<Reveal>
<div class="rounded-xs border bg-card px-4 py-3">{{ revealFixture.text }}</div>
</Reveal>
</div>
</template>
ts
import { Component } from "@angular/core";
const revealFixture = {
id: "reveal",
text: "Slides in once scrolled into view.",
} satisfies { id: string; text: string };
import { GrassrootReveal } from "@grassroot/ui-angular";
@Component({
selector: "app-reveal-demo",
standalone: true,
imports: [GrassrootReveal],
template: `
<div>
<grassroot-reveal>
<div class="rounded-xs border bg-card px-4 py-3">{{ fixture.text }}</div>
</grassroot-reveal>
</div>
`,
})
export class RevealDemoComponent {
protected readonly fixture = revealFixture;
}
export default RevealDemoComponent;
ts
<script lang="ts">
import { Reveal } from "@grassroot/ui-svelte";
const revealFixture = {
id: "reveal",
text: "Slides in once scrolled into view.",
} satisfies { id: string; text: string };
</script>
<div>
<Reveal>
<div class="rounded-xs border bg-card px-4 py-3">{revealFixture.text}</div>
</Reveal>
</div>
ts
/** @jsxImportSource solid-js */
import { Reveal } from "@grassroot/ui-solid";
const revealFixture = {
id: "reveal",
text: "Slides in once scrolled into view.",
} satisfies { id: string; text: string };
export default function RevealDemo() {
return (
<div>
<Reveal>
<div class="rounded-xs border bg-card px-4 py-3">{revealFixture.text}</div>
</Reveal>
</div>
);
}

Installation

API Reference

Import

import { Reveal } from "@grassroot/ui-react";

Props

Prop
Type
Default
Requirement
Description
as
React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined
"div"
optional
Polymorphic wrapper tag.
delay
number | undefined
0
optional
Stagger in ms (applied as transition-delay).
variant
"slide" | "fade" | undefined
"slide"
optional
Prop
as
Type
React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined
Default
"div"
Requirement
optional
Description
Polymorphic wrapper tag.
Prop
delay
Type
number | undefined
Default
0
Requirement
optional
Description
Stagger in ms (applied as transition-delay).
Prop
variant
Type
"slide" | "fade" | undefined
Default
"slide"
Requirement
optional
Description

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { Reveal } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
as
string
"div"
optional
delay
number
0
optional
variant
"slide" | "fade"
"slide"
optional
Prop
as
Type
string
Default
"div"
Requirement
optional
Prop
delay
Type
number
Default
0
Requirement
optional
Prop
variant
Type
"slide" | "fade"
Default
"slide"
Requirement
optional

Content regions

  • default

Import

import { Component } from "@angular/core";
import { GrassrootReveal } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
delay
number
0
optional
variant
"slide" | "fade"
"slide"
optional
Prop
delay
Type
number
Default
0
Requirement
optional
Prop
variant
Type
"slide" | "fade"
Default
"slide"
Requirement
optional

Content regions

  • default

Import

import { Reveal } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
as
string
"div"
optional
delay
number
0
optional
variant
"slide" | "fade"
"slide"
optional
Prop
as
Type
string
Default
"div"
Requirement
optional
Prop
delay
Type
number
Default
0
Requirement
optional
Prop
variant
Type
"slide" | "fade"
Default
"slide"
Requirement
optional

Content regions

  • children

Import

import { Reveal } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
as
string
optional
delay
number
optional
variant
"slide" | "fade"
optional
className
string
optional
style
JSX.CSSProperties | string
optional
Prop
as
Type
string
Default
Requirement
optional
Prop
delay
Type
number
Default
Requirement
optional
Prop
variant
Type
"slide" | "fade"
Default
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional
Prop
style
Type
JSX.CSSProperties | string
Default
Requirement
optional

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.