Prism Icon
webglProEt raymarchet glaskors, en ring, en kugle eller et ekstruderet logo med farvekanter, matte flader og en hældning mod markøren.
Introduktionspris til og med 31. december 2026. Derefter 79 €.
Preview
Live demo. Temaet skifter selve demoen.
Kode
Koden er låst
Prism Icon er en del af Manniche UI Pro. En nøgle åbner kildekoden til alle 66 effekter.
Køb · 49 €49 € · Introduktionspris til og med 31. december 2026. Derefter 79 €.
- Engangsbetaling
- Én udvikler
- Log ind og opret din nøgle med det samme
- Ingen moms (§ 19 UStG)
Har du en nøgle? Hent koden med CLI eller MCP.
Nøglen ligger i MANNICHE_PRO_KEY, aldrig i koden eller i adressen. Sådan sætter du den op
npx shadcn@latest add @manniche-pro/prism-iconclaude mcp add --transport http manniche-ui https://mikkelmanniche.dk/api/mcp --header "Authorization: Bearer $MANNICHE_PRO_KEY"Props
PrismIconProps
| Prop | Type | Standard | Hvad den gør |
|---|---|---|---|
shape | PrismShape | 'cross' | The glass solid. cross is an X, plus an upright cross, torus a ring, sphere a ball, and logo round-extrudes the shape of the logo image (or a built-in four-point mark when no image is given). |
logo | string | – | Image for shape="logo": a PNG, SVG or any image URL whose transparent pixels are the outside. A fully opaque picture is read by how much it differs from its top-left pixel. Cross-origin images need CORS headers; if the image cannot be read the built-in mark is used instead. |
backdropColors | string[] | DEFAULT_COLORS | What the glass looks through. WebGL cannot read the page behind a canvas, so the component paints its own plate and the glass refracts that. These colours form a soft diagonal gradient (any CSS colour, var() included). |
backdropImage | string | – | Optional photo drawn over the gradient, scaled to cover the box. Same CORS rule as logo. |
backdropText | string | – | Big headline painted on the plate, centred; use \n for a second line. The glass bends it, which sells the effect. |
backdropTextColor | string | DEFAULT_TEXT_COLOR | Colour of the plate text and pattern. Any CSS colour. |
backdropPattern | BackdropPattern | 'none' | Stripes or a grid painted on the plate: nothing shows lensing quite like straight lines. |
transparent | boolean | false | Leaves the plate empty (transparent) so the page shows around the glass. The glass itself keeps its reflections, rim and tint, so it still reads as glass; only the refracted view is empty, because the page cannot be sampled. |
ior | number | 1.45 | Base index of refraction. 1 is invisible glass, 1.5 is ordinary glass, higher bends harder. |
dispersion | number | 0.035 | How far the red and blue indices split from green. 0 is colourless, around 0.03 gives clear colour fringes. |
frost | number | 0.3 | Frosted blur of the view through the glass, 0 (polished) to 1 (heavily frosted). |
tint | string | '#ffffff' | Colour the glass body lets through. White is clear. Any CSS colour. |
absorb | number | 0.5 | How strongly the tint and the thickness darken the view through the glass. 0 is none. |
size | number | 1 | Scale of the solid inside the box. 1 fills about 60 percent of the short side. |
depth | number | 0.2 | Half thickness of the cross, plus and logo solids in world units. Thicker looks heavier and bends more. |
bevel | number | 0.14 | Bevel radius of the logo walls: 0 is a hard extrusion, near depth is a pillow. |
interactive | boolean | true | Turns on pointer lean, drag-to-orbit and, when a label is given, arrow keys with a tab stop. Without a label the icon stays decorative: it still follows the pointer and orbits when dragged, but it is hidden from assistive tech and not in the tab order. Touch uses touch-action: pan-y, so a vertical swipe still scrolls the page and only horizontal drags orbit. Under reduced motion the solid does not float or follow the pointer, but the arrow keys still turn it, one still frame per key. |
children | ReactNode | – | Drawn above the canvas, centred. Not refracted: the glass only sees the plate painted by the component. |
label | string | – | Accessible name. When set, the glass is exposed as an image (role="img"); leave it out for pure decoration, which hides it from assistive tech. Only an interactive icon with a label is focusable, as a named group. |
className | string | – | Sizes the box. The canvas fills it. |
A11y
Tastatur
With interactive (the default) the host is a focusable group with a visible focus ring. The arrow keys turn the glass. Keys typed in controls inside it, and Alt, Ctrl or Cmd shortcuts, are left alone.
Skærmlæser
With interactive the host is a group named by label, or "Glass icon". Without it, label gives the layer role="img". backdropText is painted on the canvas and is not read, so put that text in label.
Mindre bevægelse
Under reduced motion drag, pointer lean and float are off. Each arrow key turns the solid and draws one still frame. Otherwise it renders only while on screen and the tab is visible.
Andet
Without WebGL2, or after two lost contexts, a CSS glass pill replaces it, without the backdrop text. The WebGL context is released on unmount.