Docs Components Uncategorized

Figure

React example follows below.
ts
import { Figure } from "@grassroot/ui-react";
export default function FigureDemo() {
return (
<Figure title="A figure can render an image or supplied children.">
<div aria-label="Figure content">Figure content</div>
</Figure>
);
}
ts
<script setup lang="ts">
import { Figure } from "@grassroot/ui-vue";
</script>
<template>
<Figure title="A figure can render an image or supplied children.">
<div aria-label="Figure content">Figure content</div>
</Figure>
</template>
ts
import { Component } from "@angular/core";
import { GrassrootFigure } from "@grassroot/ui-angular";
@Component({
selector: "app-figure-demo",
standalone: true,
imports: [GrassrootFigure],
host: { style: "display: contents" },
template: `
<grassroot-figure title="A figure can render an image or supplied children.">
<div aria-label="Figure content">Figure content</div>
</grassroot-figure>
`,
})
export class FigureDemoComponent {}
export default FigureDemoComponent;
ts
<script lang="ts">
import { Figure } from "@grassroot/ui-svelte";
</script>
<Figure title="A figure can render an image or supplied children.">
<div aria-label="Figure content">Figure content</div>
</Figure>
ts
/** @jsxImportSource solid-js */
import { Figure } from "@grassroot/ui-solid";
export default function FigureDemo() {
return (
<Figure title="A figure can render an image or supplied children.">
<div aria-label="Figure content">Figure content</div>
</Figure>
);
}

Installation

API Reference

Import

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

Props

Prop
Type
Default
Requirement
src
string | undefined
—
optional
alt
string | undefined
—
optional
Prop
src
Type
string | undefined
Default
—
Requirement
optional
Prop
alt
Type
string | undefined
Default
—
Requirement
optional

Content regions

  • title

Native attributes

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

Import

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

Props

Prop
Type
Default
Requirement
src
string | undefined
—
optional
alt
string | undefined
—
optional
title
string | undefined
—
optional
Prop
src
Type
string | undefined
Default
—
Requirement
optional
Prop
alt
Type
string | undefined
Default
—
Requirement
optional
Prop
title
Type
string | undefined
Default
—
Requirement
optional

Content regions

  • default
  • title

Import

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

Props

Prop
Type
Default
Requirement
src
string
—
optional
alt
string
""
optional
title
string
—
optional
className
string
—
optional
Prop
src
Type
string
Default
—
Requirement
optional
Prop
alt
Type
string
Default
""
Requirement
optional
Prop
title
Type
string
Default
—
Requirement
optional
Prop
className
Type
string
Default
—
Requirement
optional

Content regions

  • default
  • title

Import

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

Props

Prop
Type
Default
Requirement
src
string
—
optional
alt
string
""
optional
class
string
—
optional
Prop
src
Type
string
Default
—
Requirement
optional
Prop
alt
Type
string
Default
""
Requirement
optional
Prop
class
Type
string
Default
—
Requirement
optional

Content regions

  • children
  • title

Import

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

Props

Prop
Type
Default
Requirement
src
string
—
optional
alt
string
—
optional
className
string
—
optional
Prop
src
Type
string
Default
—
Requirement
optional
Prop
alt
Type
string
Default
—
Requirement
optional
Prop
className
Type
string
Default
—
Requirement
optional

Content regions

  • children
  • title

Native attributes

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