MoonMoon Phase Drawing, from magick-components
The Moon in a phase, lit in gold on its unlit disc with a soft glow, turned as it looks from either hemisphere: a phase you give, or a date's. It needs no browser, so it renders on the server; today's phase is a date the page knows. Its glow's id comes from useId, so several can share a page.
import Moon from "magick-components/astrology/Moon";magick-components is on npm, under MIT (how to install it), and its source is in the app's repository.
<Moon phase={0.15} height={160} />| Prop | Type | Default | Description |
|---|---|---|---|
date | Date | The day whose phase to draw, worked out by lune. phase, when given, wins. An invalid Date throws a RangeError. | |
height | string | number | The SVG's height; from the width and the drawing's shape when not given. | |
hemisphere | "north" | "south" | "north" | The hemisphere it is seen from, which turns the Moon as it looks from there: north by default. |
phase | number | The phase to draw, from 0 to 1 as lune gives it: 0 and 1 are new, 0.5 full; anything else throws a RangeError. With neither this nor date, only the unlit disc is drawn. | |
width | string | number | The SVG's width; from the height and the drawing's shape when not given. |