Document Icon
import { DocumentIcon, DocumentPageIcon } from "stylus-ui/DocumentIcon";import { getFavicon } from "stylus-ui/utils";import { faHandshake } from "@fortawesome/pro-duotone-svg-icons";
export default () => ( <div className="flex items-center gap-4"> <DocumentIcon icon={faHandshake} /> <DocumentIcon logo={{ name: "Notion", src: getFavicon({ url: "figma.com" }), }} /> <DocumentPageIcon /> </div>);To display an icon, pass an import from @fortawesome/pro-duotone-svg-icons to the icon prop.
import { DocumentIcon } from "stylus-ui/DocumentIcon";import { faHandshake } from "@fortawesome/pro-duotone-svg-icons";
export default () => ( <div className="flex items-center gap-4"> <DocumentIcon icon={faHandshake} /> </div>);To display a logo, pass a logo object componsed of a name and image src. You can import the getFavicon helper from stylus-ui/utils to assist with this.
import { DocumentIcon } from "stylus-ui/DocumentIcon";import { getFavicon } from "stylus-ui/utils";
export default () => ( <div className="flex items-center gap-4"> <DocumentIcon logo={{ name: "Scribe", src: getFavicon({ url: "scribehow.com" }), }} /> <DocumentIcon logo={{ name: "Notion", src: getFavicon({ url: "notion.so" }), }} /> <DocumentIcon logo={{ name: "Figma", src: getFavicon({ url: "figma.com" }), }} /> </div>);Sizes range from xs to 2xl. For legibility, the smallest size does not include a container or drop shadow.
import { DocumentIcon } from "stylus-ui/DocumentIcon";import { faHandshake } from "@fortawesome/pro-duotone-svg-icons";
export default () => ( <div className="flex items-center gap-4"> <DocumentIcon icon={faHandshake} size="xs" /> <DocumentIcon icon={faHandshake} size="sm" /> <DocumentIcon icon={faHandshake} size="md" /> <DocumentIcon icon={faHandshake} size="lg" /> <DocumentIcon icon={faHandshake} size="xl" /> <DocumentIcon icon={faHandshake} size="2xl" /> </div>);Colors
Section titled “Colors”When passing in an icon, the color may also be set.
import { DocumentIcon } from "stylus-ui/DocumentIcon";import { faCalendarDays, faCameraRetro, faEarthAmericas, faHandshake, faInboxFull, faRocketLaunch, faScaleBalanced,} from "@fortawesome/pro-duotone-svg-icons";
export default () => ( <div className="flex items-center gap-4"> <DocumentIcon icon={faHandshake} color="gray" /> <DocumentIcon icon={faEarthAmericas} color="green" /> <DocumentIcon icon={faRocketLaunch} color="pink" /> <DocumentIcon icon={faScaleBalanced} color="purple" /> <DocumentIcon icon={faInboxFull} color="blue" /> <DocumentIcon icon={faCameraRetro} color="cyan" /> <DocumentIcon icon={faCalendarDays} color="yellow" /> </div>);Page Icons
Section titled “Page Icons”To display an icon representing a Page, import DocumentPageIcon.
import { DocumentPageIcon } from "stylus-ui/DocumentIcon";
export default () => ( <div className="flex items-center gap-4"> <DocumentPageIcon size="xs" /> <DocumentPageIcon size="sm" /> <DocumentPageIcon size="md" /> <DocumentPageIcon size="lg" /> <DocumentPageIcon size="xl" /> <DocumentPageIcon size="2xl" /> </div>);API Reference
Section titled “API Reference”DocumentIcon
Section titled “DocumentIcon”DocumentIcon description
className
Additional class names for the container.
color
Color of the icon.
icon
Provide a FontAwesome icon.
logo
Provide a URL to an image.
size
Size of the icon to render.
theme
Color theme.
DocumentPageIcon
Section titled “DocumentPageIcon” className
Additional class names for the container.
color
Page background branding, differentiated by shape:
- a single phase-2 accent token (
accent-1…accent-5) → solid accent, mapped to the shared stylus--accent-*tokens (new knowledge-page brand); - an array of 2+ CSS colors → the legacy multi-stop gradient (pre-phase-2 colorful headers). Pass resolved CSS colors — stylus-ui can’t import scribe-web-shared’s gradient-color map;
- omit → a random solid accent.
size
Size of the icon to render.
theme
Color theme.