DuskMoon Art Components Usage
Use @duskmoon-dev/art-components for React wrappers around the external
@duskmoon-dev/css-art CSS illustrations.
Install
bun add @duskmoon-dev/art-components @duskmoon-dev/css-art react react-dom
Import the stylesheet once at the app root:
import "@duskmoon-dev/art-components/styles.css";
For Next.js App Router, put the style import in app/layout.tsx or the root
client entry. Do not import files from dist/ directly.
Imports
All wrappers are exported from the package root:
import { ArtMoon, ArtPlasmaBall } from "@duskmoon-dev/art-components";
The package also exports @duskmoon-dev/art-components/styles.css.
Available Wrappers
ArtMoonArtSunArtAtomArtEclipseArtMountainArtSnowflakeArtPlasmaBallArtCircularGalleryArtCatStargazerArtFlowerAnimationArtColorSpinArtSynthwaveStarfieldArtCsswitch/ArtCSSwitchArtSnowballPreloaderArtGeminiInput
ArtCircularGalleryItem is exported as a TypeScript item type for
ArtCircularGallery.
Examples
Decorative art:
import { ArtMoon, ArtSun } from "@duskmoon-dev/art-components";
export function HeaderArt() {
return (
<div>
<ArtMoon crescent glow size="lg" />
<ArtSun rays pulse size="sm" />
</div>
);
}
Accessible labeled art:
import { ArtAtom } from "@duskmoon-dev/art-components";
export function AtomLogo() {
return <ArtAtom decorative={false} aria-label="Orbiting atom logo" />;
}
Circular gallery:
import { ArtCircularGallery } from "@duskmoon-dev/art-components";
export function Gallery() {
return (
<ArtCircularGallery
title="Featured"
items={[
{ title: "Moon", src: "/moon.jpg" },
{ title: "Sun", src: "/sun.jpg", alt: "Sun illustration" },
]}
/>
);
}
Interactive plasma ball:
import { ArtPlasmaBall } from "@duskmoon-dev/art-components";
export function PlasmaSwitch() {
return (
<ArtPlasmaBall
defaultChecked
=> console.log(checked)}
/>
);
}
Variant Guidance
- Most wrappers accept
size="sm" | "default" | "lg". ArtMoonandArtSunalso acceptsize="xl".ArtMoonsupportscrescentandglow.ArtSunsupportsrays,sunset, andpulse.ArtSnowflakesupportsunicodeandfall.ArtPlasmaBallsupportschecked,defaultChecked,hideBase,hideElectrode,inputProps, andonCheckedChange.ArtSynthwaveStarfieldsupportspaused.ArtGeminiInputbehaves like a styled textarea wrapper with optional before/after buttons.
All wrappers accept className, style, and CSS custom properties through
style.
Accessibility
- Decorative wrappers are hidden from assistive technology by default.
- Pass
decorative={false}plusaria-label,aria-labelledby,role, ortitlewhen the art carries meaning. - For interactive wrappers such as
ArtPlasmaBallandArtGeminiInput, pass native input or textarea props for labels, names, disabled state, and form integration.
Guidance For Agents
- Always include the stylesheet import in first-time setup examples.
- Keep wrapper names exact, especially
ArtCsswitchand its aliasArtCSSwitch. - Do not claim this package owns the underlying CSS art source; it wraps
@duskmoon-dev/css-art. - Prefer package-root imports for wrappers.
- If the user is editing this repo's source rather than consuming the package,
inspect
packages/art-components/src/index.tsx,packages/art-components/package.json, andpackages/art-components/tests/art-components.test.tsxbefore changing code.