Bedform UI
Icons
Icons used in OreUI.
OreUI does not provide an icon component. Use the SVG files directly, or inline them.
Library
| Navigation | Actions | Status |
|---|---|---|
arrow-up | chevron-up | tick |
arrow-right | chevron-right | cross |
arrow-down | chevron-down | circle |
arrow-left | chevron-left | on |
off | ||
progress-ring | ||
spinner |
Origin
Use the exported file directly when the icon does not need to inherit text color. Each icon is @bedform/ui/icons/<name>, which your bundler resolves to the SVG file's URL.
import arrowRightUrl from "@bedform/ui/icons/arrow-right";
export function NextIcon() {
return <img src={arrowRightUrl} alt="" width={16} height={16} />;
}Bundlers type SVG imports differently. If yours has no declaration for them, add one:
declare module "@bedform/ui/icons/*" {
const source: string;
export default source;
}Current color
Inline an icon inside ore-icon when it should inherit the surrounding color.
<span className="success-icon">
<ore-icon aria-hidden="true">
<svg viewBox="0 0 8 8">
<path fill="currentColor" d="…" />
</svg>
</ore-icon>
</span>.success-icon {
color: var(--ore-color-success-background);
font-size: 1.5rem;
}ore-icon is a styling element, not a component: the stylesheet sizes it and its svg, and it does not load an icon from a name. React renders it as a custom element. To type it in TSX, declare it once:
import type { DetailedHTMLProps, HTMLAttributes } from "react";
declare module "react" {
namespace JSX {
interface IntrinsicElements {
"ore-icon": DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
}
}
}Icon button
Place inline SVG inside an Icon Button and give the button an accessible label.
<IconButton type="button" aria-label="Back">
<ore-icon aria-hidden="true">
<svg viewBox="0 0 8 8">
<path fill="currentColor" d="…" />
</svg>
</ore-icon>
</IconButton>